JSON body help

hey guys I’m hoping someone can help me with this JSON body syntax or help me troubleshoot…

I have a workflow triggered by an add to the DAILY LIST table type which is a daily task list and references a parent record of MASTER LIST type which has the MASTER ITEM child records (which are the master tasks)

I want to create new child records of DAILY ITEM type (which are the daily tasks) based on the MASTER ITEM lists.

MASTER LIST has many MASTER ITEMS
DAILY LIST has many DAILY ITEMS

here is the current JSON body. I don’t know how to investigate what the issue is. I have a regular action which is creating the DAILY LISTS just fine but the child records aren’t being created by the webhook action.

1 18 300
18 REPLIES 18

Don’t you need a comma between child records? After you close the curly braket, before the <<End>> statement

if you mean this? I did so and it didn’t work. I added a comma after the UNIQUE ID()…",

as well as this popup

No I mean:

{
"DAILY ITEM ID": "<<UNIQUEID()>>",
"DAILY ITEM NAME":"<<[MASTER ITEM NAME]>>"
}
,
<<End>>
]
}

I did that and it unfortunately that did not work either

Can you test the output? I.e. put it in a document and use it as a template for a PDF

I am not sure how strict is the interpreter, however according to the example shown in the link below, the rows are separated by commas

BANG! got it thank you so much man!!!

I really appreciate it!

I maybe spoke too soon. I actually can initiate the workflow and produce the child records manually when I click test and then “execute task” I get a popup saying “Success”

but the workflow will not produce the records in the webhook for some reason still.

Since I’ve seen maybe 2 or 3 different posts from @Ethan_U about how to get webhooks working… I have to ask:

  • why use webhooks at all?

Why not just use actions?

  • It seems like everything you’re trying to do could be easily accomplished with actions.

Unless I am missing something some of the things I’m trying to do seem too slow for actions.

For instance, upon the creation of a new purchase order to then populate the Purchase order with one of each product in that vendors catalog, so they can be edited and then the final purchase order will exclude any items with blank quantities.

Maybe not the best example but if the user had to wait for those items to add one at a time via actions it would be too slow.

what do you think @MultiTech_Visions

Uh, so for example, if your app was a supermarket you would generate the entire catalog of items so your client would edit/delete the items and their quantities in order to obtain his desired order list?

Why not just let them add their items one by one as child rows? if they have to navigate to each child record to edit them i don’t think it would be any faster to do otherwise.

If your final purchase order is going to ignore items with blank quantities, you would only be generating extra rows there in my opinion.

You have a point. I like to generate the records and then sort them by location so inventory can be taken also. So even though each record may not be purchased, inventory can be recorded on it. I guess the product records themselves could have these fields which would be used to create the new line item records and then cleared afterward.

man I love this stuff haha

Bahbus
New Member

The commas are missing between the rows. That Start/End expression should be adding it.

Try:

<<START: whatever stuff>>{
   stuff,
   stuff
}<<END>>

with the START and END on the same lines as their opening and closing braces.

@Bahbus Thank you so much Im going to start digging into the documentation a bit more on this also.

My guess is with all that white space before the END, the parser is interpreting that you don’t want a comma in-between. But in JSON that I send to Discord, I have that exact layout as I put above, and it generates {…},{…},{…} no problem.

how interesting. these little details make all the difference, thank you so much

Bahbus
New Member

For more reading troubleshooting check this thread, where @LeventK figures some of it out, and what I used to get my stuff going.
Does a <> expression output a comma be… - Questions - AppSheet Creator Community

great I’ll check it out right now

Top Labels in this Space