Denormalize Json

Hi all, I’m new to Bubble and probably this is an easy question for you but I can’t find the way to solve …

I have a simple json example:
{
“invoice_id”: 12345,
“year”: 2021,
“payments_list”:
[
{
“amount”: 75,
“due_date”: “2025-08-23”,
“status”: “not_paid”
},
{
“amount”: 100,
“due_date”: “2024-08-23”,
“status”: “paid”
} ]
}

I need to start an API workflow on the following list of two records:
{
“invoice_id”: 12345,
“year”: 2021,
“amount”: 75,
“due_date”: “2025-08-23”,
“status”: “not_paid”
},
{
“invoice_id”: 12345,
“year”: 2021,
“amount”: 75,
“amount”: 100,
“due_date”: “2024-08-23”,
“status”: “paid”
}

but I can’t find the way …

Could you please help me?

Thank you in advance!

Hey
There are some plugins that make it easier to extract data from JSON.

However, I find it more practical to use the API Connector to call the API directly, allowing the connector to automatically map the data.

Then, you just use this mapped call in the workflow.

hi @jclvneto and thank you for your promptly reply.

I’m using API connector and I can set on my list invoices or (subpath) payments_list but I can’t get both on the same workflow list.

I mean tha I can send to workflow as list :
invoice_id, year and payment_list
Instead I would like to send :
invoice_id, year, amount, due_date, status

I tought about iterating in the payment_list, but there I can’t get the upper values invoice_id and year

I’m sure that there is a very easy way to do that but … I can’t really find :frowning:

Finally I found the way!!!

I did a nested workflow iterating 1st on document and 2nd on payment_list

It is a little bit tricky and I hope there is a simpler solution, but now it works!

There’s nothing tricky here. This is the correct way to do that. :wink:

@BiriBiri I’m glad to hear that you were able to solve your problem. If you have any questions, feel free to reach out to me via direct message.