Hey guys, I am pulling json data as an array from Glide to input into a pdf generation software, but I am running into a bit of a problem. As you can see in the images below in one run it pulls the data correctly as “collections” and in the other incorrectly as json. Any ideas what could be wrong?
Hi you can just use a parse JSON module after the webhook or make sure you have JSON pass-through as No.
In fact I would try the other way, since the data received from the request is not consistent.
Set JSON pass-through to Yes, then use a Parse JSON module after that.
You can do that by setting the Webhook “JSON Pass-through” to YES (it is “No” by default), when creating or editing a webhook.
This way we can see why some “other deviations” are not parsing correctly.
If you need further assistance, please provide the following:
Please provide the output bundles of the trigger by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
A.
Save each bundle contents in your text editor as a bundle.txt
file, and upload it here into this discussion thread.
Uploading them here will look like this:
module-1-output-bundle.txt (12.3 KB)
B.
If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:
-
Either add three backticks
```
before and after the code, like this:```
input/output bundle content goes here
``` -
Or use the format code button in the editor:
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
Thanks but would I have to add a parse json for every array that gets passed via the web hook?
And do you know why the data would be inconsistent?
[
{
"Location": "MAKHAZA",
"Manager on duty": "Noluthando Makoma ",
"Signature": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/PjrqGSCEdAHEdvwoYt4A.png",
"date only": "17 Jul 2024",
"Start time": "2024-07-17T10:35:00.000Z",
"End Time": "2024-07-17T12:05:00.000Z",
"Location code": 4864,
"Region": "WCAPE FLATS",
"🔒 Row ID": "5Rkxy8lCSpeN-MVek9GMig",
"total percentage": 95,
"Actual Audit Result": "Compliant",
"Store Image": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/CZBRXb4DYofIMhIYi1c6.jpg",
"array section": [
{
"section": "Food Safety",
"items": 53,
"passed": 53,
"percentage": "100%"
},
{
"section": "Ops Standard",
"items": 102,
"passed": 96,
"percentage": "94%"
},
{
"section": "OHS",
"items": 20,
"passed": 18,
"percentage": "90%"
}
],
"array categories": [
{
"category": "Customer Area",
"items": 30,
"passed": 28,
"percentage": "93%"
},
{
"category": "Front of House",
"items": 13,
"passed": 13,
"percentage": "100%"
},
{
"category": "Middle of House",
"items": 36,
"passed": 35,
"percentage": "97%"
},
{
"category": "Back of House",
"items": 28,
"passed": 26,
"percentage": "93%"
},
{
"category": "Storage",
"items": 40,
"passed": 40,
"percentage": "100%"
},
{
"category": "General Administration",
"items": 16,
"passed": 16,
"percentage": "100%"
},
{
"category": "Occupational Health & Safety",
"items": 12,
"passed": 9,
"percentage": "75%"
}
],
"array past results": [],
"formatted duration": "01:30",
"Auditor": "Bongiwe",
"Ops Manager": "Gerhard Kotze",
"regional manager": "Thobile Ngozi",
"critical deviations": [],
"other deviations": [
"{\"section\":\"Customer Area/Lobby\",\"question\":\"Furniture Clean & In Good Repair\",\"result\":\"No\",\"image\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/o9XWfYlA5i6dYbJNOv3k.jpg\",\"image2\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/0VvC3eVX8melqhLDGf8o.jpg\",\"image3\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/eObWWjFHW1W58OgCo76V.jpg\",\"comment\":\"Upholstery on couches worn out. Lobby tables in need of repair \"}",
"{\"section\":\"Customer Area/Lobby\",\"question\":\"Tables Cleared within 5 minutes of Customer Leaving\",\"result\":\"No\",\"image\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/ri1cjHMTVEECkvvhybW2.jpg\",\"comment\":\"Tables not cleared more than 5 minutes after the customer left the lobby\"}",
"{\"section\":\"MOH/Packing Station\",\"question\":\"HWC Product Appearance to Standard\",\"result\":\"No\",\"image\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/9l1g6qCVll7GYuYhAYnm.jpg\",\"comment\":\"Drumstick bone out, correct breading procedures to be followed\"}",
"{\"section\":\"BOH/Chicken Fryers\",\"question\":\"Extractor Operational, Clean & In Good Repair\",\"result\":\"No\",\"image\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/YjTyaNlxjnboQr0oBMHI.jpg\",\"comment\":\"Vent cover missing from extractor, metal strip lifted from one end\"}",
"{\"section\":\"BOH/Breading Station\",\"question\":\"Breading Sifted Procedures Followed\",\"result\":\"No\",\"image\":\"https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/ZqbiIUaq7GLZt1PxGHbU/pub/K7qwnTqSsVTFmyERdLnH.jpg\",\"comment\":\"Zamba mix showings lumps, not sifted \"}",
"{\"section\":\"OHS/First Aid Box\",\"question\":\"First Aid Box Fully Stocked\",\"result\":\"No\",\"comment\":\"Bandages missing\"}",
"{\"section\":\"OHS/First Aid Box\",\"question\":\"Directional Signage in Place\",\"result\":\"No\"}"
],
"total percentage rest": 5,
"Store email": "4864@stores.hungrylion.co.za",
"Location manager email": "gerkotze@hungrylion.co.za",
"Regional manager email": "tngozi@hungrylion.co.za"
}
]
You’ll probably need to check what’s actually stored in Glide. It looks like “other deviations” are stored as an array of JSON strings sometimes.
Could you provide screenshots of what you see in Glide?
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
It is not ideal but there are about 150 if statements with json templates as every entry will have a different number of “deviations” so if result is “no” then add json template to the array
If you are storing them as JSON, then you need to Parse JSON for each array item.
I highly recommend you do not store them as “json templates”.
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
Do you know what the cause of the inconsistency would be? I Have ran over 50 scenarios with the exact format in glide and it has never returned it this way.
That’s probably for another question thread, since you’ll need to post about how you are originally creating and adding them in the first place.