Forum Academy Marketplace Showcase Pricing Features

Saving images using Multi-file uploader + Deleting a file URL from a List created with the Multi-file uploader

Hi,

First of all I want to thank you (who stopped by my post) and the entire Bubble community for all the help you provided me (and other people like me) through the various topics and discussions I could find online! This is truly unbelievable the amount of knowledge you’ve been sharing over time. Thank you :pray:

This article is quite extensive but covers a few topics that don’t seem to be fully resolved online so I’m sure it will help a lot of people :slight_smile:

Once again, thank you for your help.

------------- CONTEXT --------------

I’m building a market place (let’s say similar to airBnB for example) where each ‘user’ can create a ‘host profile’ (as a Thing) and upload a list of images (multiple photos of their house for example).

------------- PROBLEMS / CHALLENGES --------------

I have 2 main problems described here below:

- Problem 1: not all photos are saved in my list of images while all files are uploaded to S3 (see File Manager).

- Problem 2: I can’t find how to Remove an ‘item’ from a list of URLs where the item position corresponds to the index of the cell of the repeating group in which this URL is stored (note that my repeating group’s type of content is ‘Images’ and not URLs, that might have an impact here below)

------------- UPLOADING IMAGES > WHAT I DID --------------

I built a workflow using the Multi-file uploader and a ​Save button to do 3 things:

  1. Save the uploaded files in S3 >>> WORKS

  1. Save the S3 URLs of each file in my Thing ‘Host profile’ in a field (list) called ‘photo (file list)’ (see screenshot below) >>> WORKS

  2. Save each image in my Thing ‘Host profile’ in a field (list) called ‘photo (image list)’ >>> DOES NOT WORK (for some reason not all my images are added to that image list field )

Both fields [photo (file list)] and [photo (image list)] are LISTS:

Here is the Workflow I built to do this:
Step 1: Save uploaded files as a list of URLs

Steps 2, 3 and 4: Save each image independently with a condition on the amount of images uploaded so that I don’t create empty URLs if the user uploads less than 3 images.

Save Image 1:

Save Image 2:

Save Image 3:

------------- RESULT OF UPLOADING IMAGES --------------

I tried uploading 3 files (Chalet, House, Castle):

  • All 3 files are uploaded in S3 with a URL each and appear in my file manager
  • All 3 files are saved as a list of URLs in my first field
  • Only the first image is saved to in my second field (BUG)

Result on the platform:

This is based on the following repeating group which contains ‘Images’ from my ‘photo (image list)’:

MY QUESTION: Why are all my images not added to the field ‘photo (image list)’?

------------ DELETING IMAGES 1 BY 1 > WHAT I DID -------------

I added a ‘Bin’ icon to be able to delete 1 photo at a time. When I click this button I want to delete 3 assets:
Step 1: delete the uploaded File in File manager > Workflow = ‘Delete uploaded file’ >>> WORKS

Step 2: delete the Image corresponding to the image I want to delete from my list of images > Workflow = ‘Make changes to Host profile’ >>> WORKS

Step 3: delete the URL corresponding to the image I want to delete from my list of files > Workflow = ‘Make changes to Host profile’ >>> DOES NOT WORKS

I tried 2 alternative workflows for step 3 but none of them seem to work:
Step 3 - alternative 1:

Step 3 - Alternative 2:

MY QUESTIONS:

  • Which workflow should I build to delete/remove the right URL from my list of URLs in the field ‘photo (file list)’?
  • Why using the cell index of my repeating group where I click the Bin button doesn’t seem to let me identify the position of the URL to delete in the list?
  • Is my list well composed of multiple URLs separated by commas or is it just one long string of text?