Hi there - wondering if someone can help me before I tear what currently remains of my hair out.
I’m trying to send an external PUT request to an API endpoint and I’ve got 99% of it working but I can’t get the array of “ASN items” into the right format for it to be accepted at the other end. If I use format as JSON safe it accepts the creation of the main item but then can’t find the Products because random \ are being inserted into the data. Please help!
So this is where I search for the items and format the data as text
Hey, thanks for the suggestion - I’ve narrowed the issue down to the quirk of bubble inserting /n between each object in an array:
“Items”: [{“ProductId”:267240,“SKU”:“BTR-408 Monza Waterfall High Rise Mono Basin Mixer TapHIG001”,“Quantity”:1}\n,{“ProductId”:267241,“SKU”:“BTR-408 Tap holeWE12TEST”,“Quantity”:1}\n,{“ProductId”:267242,“SKU”:“BTR-408 Tap hole insertWE12TEST”,“Quantity”:1}\n]
I’ve checked and can’t see any spaces (although I can only see two arrows on your screen grab). In terms of Json safe - I’m a bit confused as /n is technically the json safe way of doing a line break isn’t it? But there aren’t any line breaks so I don’t know why it’s being added in.
THanks for the suggestion - It didn’t resolve the issue. So I don’t think it’s anything within the individual object. I saw a different thread and they suggested using request catcher, which I did…
Ugh. So annoying. I’d try 2 things. After setting the state, in a separate action find and replace"\n" and try saving it all on the back-end without it passing thru a custom state.
Remove the dynamic fields and replace them with static values, this should allow you to modify the complete JSON in your Workflow. It’s easier to debug and in case the data is empty, it will not trigger any issues executing the workflow.
I’d recommend you use format as json safe to avoid having empty fields where possible and replace empty numbers with a null value.