# JSON template + Joined LIst + Call API

**URL:** <https://community.glideapps.com/t/json-template-joined-list-call-api/75959>\
**Category:** Ask for Help\
**Created:** [August 29, 2024, 4:51am UTC](https://community.glideapps.com/t/json-template-joined-list-call-api/75959 "2024-08-29T04:51:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lof](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_lof/32/48029_2.png) [@Daniel\_Lof](https://community.glideapps.com/u/Daniel_Lof)\
**Post date:** [August 29, 2024, 4:51am UTC](https://community.glideapps.com/t/json-template-joined-list-call-api/75959/1 "2024-08-29T04:51:39Z")

</div>

Hi guys,

I’m stuck on a task where I need to send a payload in a certain structure to an api endpoint.

Basically it creates a sales order in an ERP system using the data from glide.

This is the json template:

{  
“OrderNo”: 0,  
“DeliveringCustomer”: $erpid,  
“InvoicingCustomer”: $erpid,  
“StoreId”: 1,  
“SalesOrderDTORows”: [  
{  
“ProductId”: $prodcode,  
“Quantity”: $qtys  
}  
]  
}

All good but the tricky part is this:

“SalesOrderDTORows”: [  
{  
“ProductId”: $prodcode,  
“Quantity”: $qtys  
}  
]

If I send an order where there’s multiple product rows it sends them as

{  
“ProductId”: $prodcode,$prodcode,$prodcode,$prodcode,  
“Quantity”: $qtys,$qtys,$qtys,$qtys  
}

When it should send them as separate entities:

{  
“OrderNo”: 0,  
“DeliveringCustomer”: $erpid,  
“InvoicingCustomer”: $erpid,  
“StoreId”: 1,  
“SalesOrderDTORows”: [  
{  
“ProductId”: $prodcode,  
“Quantity”: $qtys  
}  
{  
“ProductId”: $prodcode,  
“Quantity”: $qtys  
}  
{  
“ProductId”: $prodcode,  
“Quantity”: $qtys  
}  
{  
“ProductId”: $prodcode,  
“Quantity”: $qtys  
}  
]  
}

I’m kinda thinking in the line of using this json object I’ve created per sales row:

{ “ProductId”: “6430057275030”, “Quantity”: 1 }

And joining them as a list but only for the relevant sales order. But can I have a json object in a json template and I’m overthinking how to create the joined list of objects to only include the data for the specific order. So the question is, how would I go about this?

I can send orders with single rows and it works fine.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 29, 2024, 6:32am UTC](https://community.glideapps.com/t/json-template-joined-list-call-api/75959/2 "2024-08-29T06:32:14Z")

</div>

Instead of using a Joined List of JSON Objects, use a Lookup.

---

<div class="post-metadata">

**Author:** ![Daniel\_Lof](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_lof/32/48029_2.png) [@Daniel\_Lof](https://community.glideapps.com/u/Daniel_Lof)\
**Post date:** [August 29, 2024, 7:02am UTC](https://community.glideapps.com/t/json-template-joined-list-call-api/75959/3 "2024-08-29T07:02:16Z")

</div>

Hmm… not quite sure I follow 🤔

---

<div class="post-metadata">

**Author:** ![Daniel\_Lof](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_lof/32/48029_2.png) [@Daniel\_Lof](https://community.glideapps.com/u/Daniel_Lof)\
**Post date:** [August 29, 2024, 7:10am UTC](https://community.glideapps.com/t/json-template-joined-list-call-api/75959/4 "2024-08-29T07:10:07Z")

</div>

Actually, I had a strong coffee, and now I follow. Using lookup did the trick. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [September 5, 2024, 7:11am UTC](https://community.glideapps.com/t/json-template-joined-list-call-api/75959/5 "2024-09-05T07:11:02Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
