Help with API Workflow on a List

Hello Bubble Forum,

While I think I am going to find another way to work this, I do see some clever people in this forum and at this point, just curious if what I was attempting was even possible.

First and foremost, to the admins behind this platform, I am enamored with what you have built. Truly amazing platform!

To simplify this scenario, lets say this application is used for kitchen projects. Each Kitchen has various segments. Sink, Faucet and Disposer. I have a data type where Sink, Faucet and Disposer are each separate rows (or things) and each row has a Good, Better and Best price.

I have a requirement to import in files in which the Good, Better and Best prices are on separate rows, not within the same row (CSV). So Sink would be represented as 3 rows. One for Good, one for Better and one for Best in the external file I am uploading. However my local Data Type in which I need to append this data as stated above is one row with 3 attributes (Good, Better and Best).

So my approach to this and first getting into using API Workflows on a List was to:

  1. Use File Uploader to bring CSV into bubble storage (AWS). This works perfectly.

  2. Use Upload data as CSV to read the imported file and place the data in a Data Type that is for temporary data storage. This also works perfectly.

  3. Use an API Workflow on List in which the list to run on is filtered for only Good, so that takes my 3 rows per project segment (Sink, Faucet or Disposer) and reduces them to single rows. This writes the values into my permanent Data Type. This also works perfectly!

  4. My thoughts were to then run an API Workflow on List but instead of Create a Thing, use Make Changes to a Thing, thinking this would be the same iterative run through, except instead of adding new records, it would edit the Better and Best fields. This I cannot get to work. The problem is my List to Run on has an ID that joins the 3 rows of each same project segment (Sink, Faucet or Disposer) but I am not even close to figuring out how I can somehow relate the List to Run On to a specific row in my Data Type I am making changes to??

As you can see, I cant even really articulate my situation well to begin searching the forum for a possible solution. In laymen terms, I want to look at each row in my List to Run On, grab an ID, find that same ID in my other Data Type and edit two of the fields from my List to Run, then continue until end of recordset.

My solution is to have my developer spit the data out of my main production application (nothing to do with Bubble) and add additional columns so each project segment is a single row, which is how the data structure in Bubble is setup. This will absolutely work and simply meant passing my problem to someone else :). I am just curious if this could have been done in Bubble and thought I would ask in event I run into future situations that are similar.

Hi @ktobias :slight_smile: Just want to make sure I’m understanding your app’s setup correctly – you have two main data types: Kitchen and Project Segment (a Project Segment can be either a sink, faucet, or disposer, and each Project Segment row is priced at Good Better or Best)?

You have all of the data for this uploaded via CSV, and you need to associate the Project Segment things with each Kitchen thing?

Can you clarify the above and share some screenshots of your app’s data structure and perhaps the app data as it now? (Sorry for so many questions, just want to make sure I’m understanding correctly!) :slight_smile:

Hi @fayewatson, thanks for the reply. Actually in this scenario we are dealing with one data type. The project of kitchen is repeated in the data type for each different segment. So my segment contains all the necessary data in a single row. My “sink” would have a good, better and best price point.

The data I am importing via CSV has a separate row for each price point. So “sink” exists in three rows and each row is labeled good, better or best. In that row it provides the price point respectively.

This was just something that bothered me, so was just curious if I was missing something obvious? I have built an Access application that took in the CSV and grouped and exported it out as I needed it for the Bubble app. So the question here was just so I could expand my experience a bit.

From an old school Access perspective, was wondering how I could group the data by Project Type (kitchen) and Segment (sink or faucet or sink) then append that concatenation into single rows in my Data Type. In Access I took the data and drafted three queries. The criteria in each was good or better or best, so now I am seeing a single row for each Segment and quality grade. Then joined them and appended to a new table. Used that table to import as CSV into Bubble app.