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 Like

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

1 Like

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>>
]
}
1 Like

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

great idea! the email sent with this in the body. So why are the new records not being created when the same JSON text is used in the body of the webhook? hmm

{
“Action”: “Add”,
“Properties”: {
“Locale”: “en-US”,
“Location”: “47.623098, -122.330184”,
“Timezone”: “Pacific Standard Time”
},
“Rows”: [

{
“DAILY ITEM ID”: “13324d4e”,
“DAILY ITEM NAME”: “* COOK MARINARA SAUCE”
}

{
“DAILY ITEM ID”: “44e2149b”,
“DAILY ITEM NAME”: “* PULL GARLIC BUTTER AT 9:00 AM”
}

{
“DAILY ITEM ID”: “64842ea6”,
“DAILY ITEM NAME”: “*MEATBALLS IN OVEN AT 9:00 AM”
}

{
“DAILY ITEM ID”: “b80b10ca”,
“DAILY ITEM NAME”: “BREADED CHICKEN (4)”
}

{
“DAILY ITEM ID”: “54c7738e”,
“DAILY ITEM NAME”: “1. HOMEMADE SAUSAGE (1)”
}

{
“DAILY ITEM ID”: “fe3e258b”,
“DAILY ITEM NAME”: “CHICKEN IN MILK (2)”
}

{
“DAILY ITEM ID”: “1aa259dc”,
“DAILY ITEM NAME”: “CHOPPED PARSLEY (3)”
}

{
“DAILY ITEM ID”: “f5fc8297”,
“DAILY ITEM NAME”: “BRAISED PORK FOR BOLOGNESE( 2)”
}

{
“DAILY ITEM ID”: “e2355aa3”,
“DAILY ITEM NAME”: “BREADED CAULIFLOWER (30)”
}

{
“DAILY ITEM ID”: “8526273e”,
“DAILY ITEM NAME”: “COCKLES CLEAN & READY (6)”
}

{
“DAILY ITEM ID”: “75a228a4”,
“DAILY ITEM NAME”: “BUTTER GLAZE (2)”
}

{
“DAILY ITEM ID”: “60f8cf83”,
“DAILY ITEM NAME”: “CHOPPED PROSCIUTTO (3)”
}

{
“DAILY ITEM ID”: “f7f17985”,
“DAILY ITEM NAME”: “CLAM STUFFING (1)”
}

{
“DAILY ITEM ID”: “166ba7e4”,
“DAILY ITEM NAME”: “LOBSTER TOM. SAUCE (1/2)”
}

{
“DAILY ITEM ID”: “9efded38”,
“DAILY ITEM NAME”: “CLEAN BLACK KALE”
}

{
“DAILY ITEM ID”: “d0d03190”,
“DAILY ITEM NAME”: “COOK & STUFF CLAMS (2)”
}

{
“DAILY ITEM ID”: “67aa9ca7”,
“DAILY ITEM NAME”: “GARLIC BUTTER (10)”
}

{
“DAILY ITEM ID”: “250d75a8”,
“DAILY ITEM NAME”: “GARLIC CONFIT (1)”
}

{
“DAILY ITEM ID”: “29782864”,
“DAILY ITEM NAME”: “HOUSE MARINADE (0.5)”
}

{
“DAILY ITEM ID”: “d81a6516”,
“DAILY ITEM NAME”: “MOZZARELLA STICKS BREADED (3)”
}

{
“DAILY ITEM ID”: “ea1afa94”,
“DAILY ITEM NAME”: “MOZZARELLA TRAYS (2)”
}

{
“DAILY ITEM ID”: “2470c438”,
“DAILY ITEM NAME”: “LEMON JUICE (2)”
}

{
“DAILY ITEM ID”: “e05c61d8”,
“DAILY ITEM NAME”: “MARINATED TOMATOES (3)”
}

{
“DAILY ITEM ID”: “eae23911”,
“DAILY ITEM NAME”: “MEATBALLS IN SAUCE (4)”
}

{
“DAILY ITEM ID”: “1829cda0”,
“DAILY ITEM NAME”: “MOZZARELLA FOR PARMS”
}

{
“DAILY ITEM ID”: “9b88bda1”,
“DAILY ITEM NAME”: “ROASTED BEETS”
}

{
“DAILY ITEM ID”: “7f0c9d4b”,
“DAILY ITEM NAME”: “PORK WHOLE IN WALKIN (8)”
}

{
“DAILY ITEM ID”: “0e62409f”,
“DAILY ITEM NAME”: “RED SHRIMP PORTIONS (50)”
}

{
“DAILY ITEM ID”: “77e564ce”,
“DAILY ITEM NAME”: “SAUSAGE PORTIONS (50)”
}

{
“DAILY ITEM ID”: “6a098197”,
“DAILY ITEM NAME”: “SPICY TOMATO SAUCE (1)”
}

{
“DAILY ITEM ID”: “f7a4065d”,
“DAILY ITEM NAME”: “THAWED RED SHRIMP (4)”
}

{
“DAILY ITEM ID”: “9b54d7f1”,
“DAILY ITEM NAME”: “Z - CLEAN AND ORGANIZE PREP TABLE AND SHELF BELOW”
}

{
“DAILY ITEM ID”: “b8438722”,
“DAILY ITEM NAME”: “Z - CLEAN FOOD PREP SINK”
}

{
“DAILY ITEM ID”: “af79954f”,
“DAILY ITEM NAME”: “Z - CLEAN WALLS”
}

{
“DAILY ITEM ID”: “aa85ad29”,
“DAILY ITEM NAME”: “Z - DAILY CLEANING PROJECT”
}

{
“DAILY ITEM ID”: “daec2d5b”,
“DAILY ITEM NAME”: “Z - ORGANIZE AND CLEAN PREP SHELF”
}

]
}

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

2 Likes

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

I really appreciate it!

1 Like

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.
5 Likes

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.

2 Likes

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

1 Like

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.

3 Likes

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

1 Like

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

3 Likes

great I’ll check it out right now