Skipping empty cells in data upload workflow

Hi All, I’m having an issue where I’m uploading a CSV (using 1t-CSV plugin) and sending the data to a recursive workflow to create a list of products, but somewhere in the process it’s skipping empty numerical cells. See below, column AB, what was meant to be uploaded, column AC, what was uploaded.

The data flow

  1. Upload CSV to 1t-csv plugin and plugin sends JSON to API Connector. @eli don’t think the issue is here but you can confirm

  2. Data sent from API connector to workflow csv_upload_product_router

  3. API workflow ‘csv_upload_product_router’splits data into it’s distinct fields and sends to ‘csv_upload_product

  4. csv_upload_product’ creates ‘product’ which runs a recursive workflow

Below is what happens when I upload some sample data - focus on the ‘Dimensions - W’ cell.

1) Upload CSV to 1t-csv plugin and plugin sends JSON to API Connector

You can see the JSON data the plugin creates to send to the API connector here:

“Dimensions - W”: “90.5”

“Dimensions - W”: “”

“Dimensions - W”: “20”

2) Data sent from API connector to workflow csv_upload_product_router

“Dimensions - W”: “90.5”

“Dimensions - W”: “”

“Dimensions - W”: “20”

3) API workflow ‘csv_upload_product_router’splits data into it’s distinct fields and sends to ‘csv_upload_product

“Dimensions - W”: “90.5”

“Dimensions - W”: “”

“Dimensions - W”: “20”

4) ‘csv_upload_product’ creates ‘product’ which runs a recursive workflow

The empty cell is missing here.

When it goes to run the recursive workflow, it should be Dimensions -W: [90.5,20] but is instead Dimensions -W: [90.5,20]

Bubble’s default behavior for API workflows is to ignore empty parameters, which is why it’s not clearing the value and is instead keeping the data from the previous item in the loop. To fix this, you need to tell Bubble to explicitly accept the empty value by using the `:formatted as JSON-safe` operator on the field within your ‘Make changes to a Product’ workflow action

1 Like

Thanks for the input.

  1. When You say ‘Make changes to a product’action I’m presuming you mean ‘Schedule API workflow csv_upload_product’ action since that’s where we schedule the recursive workflow.
  2. I tested out what you suggested, both in the ‘Schedule API workflow csv_upload_product’ action and the ‘create a new product’ action (thats where we set the ‘dimensions - W’ field) and neither of them have the option to :formatted as JSON safe

Really sorry, but as you picture show a complex flow, can you record a loom , showing whee that field is being set, whcih is being empty.

i will love to debug it for you

Let me know if it doesn’t work for you / isn’t clear.

Solution I’ve implemented that seems to work. Keep the numbers as a list of texts [“90”,'“,”20”,””,”34”] until I actual save them, at which point I convert to number. Seems to work.

1 Like

That is the solution, You were saving text in number field in backend , thats why its was truning empty. and because you were workign in backend when set this up it was not giving you and issue