Issue getting the link between order and order line items from a nested JSON response

I have a JSON response from an external API which contains orders and associated order lines in a format similar to:

{
“orders”: [
{
“orderId”: “14-13152-34229”,
“lineItems”: [
{
“lineItemId”: “10072911419614”,
“title”: “Example Product“,
“quantity”: 1,
}
],
}
]
}

My Current Process:
I’ve been following this tutorial from Jacob which has been extremely helpful (Thank you Jacob): https://youtu.be/ZaD9AIegH5A?si=xo8J1hrybqsvPI20

  1. Get JSON response from an external API
  2. Use the JSON response in a Post request to bubble’s built in bulk creation api to create orders
  3. Use the JSON response in a Post request to bubble’s built in bulk creation api to create line items

But this doesn’t give me the ability to add the related order to the line items data to then link them in the database. Does anyone know how I go about doing this?

You need to use a backend WF instead and Schedule API Workflow on a list (of the type of API call list)
This way, you will be able to use Do a search for and find the related order.

Thank you @Jici , I had tried a backend workflow before but I obviously had entered the wrong field type somewhere so it wasn’t working. I’ve taken another look and it is now working :slight_smile:

1 Like