Compare old/new image before saving and overriding?

I’m not sure how to implement this in Bubble - I’ve poked around at the work flow and don’t see actions that map. I’m just in planning phase right now so wondering if someone could talk me through this.

I have a form where a user can submit text + photos.

User can also go back and EDIT text or photos.

Editing text is easy, in the workflow, on Button Submit is clicked, I just make changes to the Object, with the database_text_field = text field’s value.

With editing photos, I only want to change the photo IF they have overridden the old photo with a new one. I don’t see a possible way to detect if the photo in the Photo Uploader widget has changed?

(I know database workflow has a before versus after change, but this is just a standard front end make changes to a thing workflow)

Yes images values cannot be compared, you can check it via when picture uploaders value is changed

you can compare image values by comparing the urls or the filenames

if picture uploaders filename is not current records filename

alternatively you could just make the image update explicit by adding a button so the user chooses if the image is updated

@mitchbaylis, in the workflow I don’t think I have access to the NEW filename, in other words, they’re on the form, they have clicked the picture uploader input widget to upload a file, in the workflow, I only have these options (not filename)

(attachments)

consider using a different uploader plugin… there are many that give you the filename, size etc

1 Like

Try uploading same picture twice and check files of your app, you will see 2 identical images with different urls

I use an uploader and then compare the name, mimetype and size to ensure there aren’t duplicates in the database… works fine (until the user wants a duplicate… which they eventually did!)

@mitchbaylis what uploader do you use?

filestack

just use the bubble image uploader or file uploader…use a workflow trigger when input value is changed, make it for the uploader of choice and then have it update the database entry to be the uploader value, but also ensure you delete the previous image from the file manager.

You can use that same approach for image uploader or file uploader as well…in the make changes to thing, just make the image field equal to uploader value…ensure you have initial content on uploader set to the database entry value so that if no changes it is the same but if changed it is the new value.

This topic was automatically closed after 70 days. New replies are no longer allowed.