Skip to main content
← Data, API & Backend
Data, API & Backend November 16, 2021 · 5 replies

PATCH request and [component:input-image] tag

Archived from the Bravo community forum (2021–2026). Some answers may refer to older versions of Bravo.

I was working on the edit screen where I bind my data using a GET request and then submit them through PATCH request.

My problem is that when I leave all my inputs unchanged, the image input is being overwritten anyway (by empty value).

How can I prevent that?

5 replies

Javier Felipe Bravo team November 21, 2021

Hi ,

At the moment, this is the expected behavior, so changing only some fields of the record by leaving input fields empty is not possible.
We'll investigate if we can support this in a easy way, if that's the case, we'll let you know.

Lukas November 21, 2021

Hey ,

I'm actually not leaving any inputs empty. First I GET current data, bind it to the same layers that will be used in PATCH request and only then I submit it.

[email removed]

All this works great. Even when I have Airtable opened and I submit my data, I can see it only changes cells that have been changed (which is the advantage of PATCH compared to PUT, right?).

The only problem are images. I have no way to inspect what is happening behind the scenes but I think that Bravo transforms [component:input-image] tagged layers into actual file inputs (to make native file input behavior possible).

[email removed]

If that's correct, then Bravo probably doesn't even consider what image is already applied to that layer. This would align with the documentation where it says "(about input-image) turns a rectangle or image into an upload image input field".

Side note: I actually don't like this approach because it means that I need to export my image input design first and then apply it to the Figma layer to keep its appearance. So what I do instead is I overlay my Figma's image input design with a transparent image (1px x 1px fill) and add the Bravo tag to that:

[email removed]

This way when I update my Figma component, it also propagates to my Bravo-ready files. Maybe it could be something that Bravo does by itself? This way You could reduce actions necessary to make Figma designs Bravo-ready to tagging and framing only.

Anyway - I've got sidetracked 🙂 If it was possible for Bravo to recognize if [component:input-image] tagged layer has an image already applied to it and prefill native input with it, then I think edit would work exactly as expected.

(sorry for long post)

rex December 26, 2022

I am suffering from the same issue. In the profile page for the user, when I don't change the image file, the PATCH calls resets the image file anyways (NULLs out the field in airtable).

Any fixes for this? Bravo team - this is a showstopper for us since every time we edit the profile page for the user, the image gets reset. Could you please provide a fix or a workaround for this?

Sammy December 6, 2023

I’m having the same issue. Has there been any update to this or has anyone got a workaround? 

Is there even a workaround if you don’t even give an option to change the image?

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord