Hello, I am using the Bubble Api connector plugin to connect to an external service which removes the background from my pictures and returns a picture with no background as shown below :
The problem here is that the API returns a picture and does it everytime I refresh my page so the same image is stored multiple times in “Files” I want to find a way to prevent this if you can help thank you 
Hello, I noticed that duplicate recorded items have the same id, have you ever thought about restricting when saving, to check if that id already exists and not save the same id?
Hello, thank you for your response but I don’t think that will solve my problem as there will be multiple users that can call the API . I will still have duplicates with different User Id.
Can you post an example of the API response or the API provider you are using? Usually the response will include a unique ID (separate from anything in your Bubble database) to help prevent exactly what you’re encountering here.
It looks like the image itself triggers the API call, so each time the page is refreshed the API call is triggered as expected with this setup. Maybe tag the images in the database (filename ; processed = yes) to mark if they have been through the API and then conditionally change the image to either show the API version or the already processed version. Or am I completely missing the point here?
Why not just process the images when uploaded, then save them to whatever datatype you’d like? That way, rather than processing it with the API on every page load, you just make the data source the pre-processed image.
Thank you for your response but I can’t do that because the images may change over time, they are stored in the database and only the 3 last records are shown on my element
I have thought of that but the images can change, they are stored in the database but only the 3 last records are processed via the API
Thank you but the API I am using is not free so I am trying to process the least amount of images I can (only the 3 last records are processed and shown on my element)
Here is a response example :
you can find it here : https://www.remove.bg/fr/api#api-reference
Hmm how frustrating there doesn’t appear to be a uniqueid.
How about this? If you can rename the file to make the file name unique will that solve your issue How to rename files when saved to S3 - #3 by bartek.dev