Post with array input cannot have lambda in function stack?

I have a POST endpoint that is ingesting webhooks from a third party (wrike). The payloads are a single array like this:
[
{
"title": "Follow up on status of RFI with Architects",
"taskId": "IEACIWZSKQZGQVIU",
"oldValue": "Follow up on status of RFI with Architect",
"eventType": "TaskTitleChanged",
"webhookId": "IEACIWZSJAABNRYU",
"eventAuthorId": "KUAEW7KF",
"lastUpdatedDate": "2023-03-05T20:48:17Z"
}
]
When anywhere in my stack i try to do a lambda step, i get the following error: ["$input must be an object"].
My lambda code is not part of the error, i've set the code to: return "John Doe";.
It seems like the lambda is expecting the $input parameter to always contain an object, which is not always the case with webhooks.
Is there any way to fix this?
Answers
-
Why don't you check first if the "Get All Input" result is an object or not with the filter "is_object". If it is false, just create an object containing whatever the result was. Then do the lambda step.
Categories
- All Categories
- 46 π£ Announcements
- 47 π¦Ύ Releases
- 36 π Welcome
- 924 π€· Help! I'm a Noob
- 113 π± No-Code Front-Ends
- 597 π Working with APIs
- 418 π’ Transforming data
- 120 π Connect Xano to ...
- 46 π§βπ» Find an Expert
- 320 βOther questions
- 32 π Security
- 22 βοΈ Snippets
- 19 π Showcase
- 7 π£οΈ ο»Ώ Xano Chatter
- 60 πΊ Video Tutorials
- 166 π Request a feature
- 219 π Report a Bug
- 19 π Templates & Extensions
- 6 π¬ Feedback