Looks like results is an array. Zapier expects a single object representing the thing the action just created. Rather than wrapping the array in brackets, I think you’re going to want to reach into the array and pull out the object that represents what you want to return to the user. If you post the contents of your results we can provide better insight, if that doesn’t get you up and running.
Hi Zane,
Thanks for the quick response.
Here is the result I need from each item in the array:
{
"id": 12345,
"customer": 4321,
"deleted": false,
"deleted_date": null,
"photo_url": null,
"image": null,
"mobile_phone2": "",
"mobile_phone3": "",
"home_phone": "",
"office_phone": "",
"create_source": "",
"update_source": "",
"customer_user_id": "",
"user_type": "person",
"last_login": "",
"is_superuser": false,
"is_staff": false,
"is_active": true,
"date_joined": "",
"first_name": "First",
"last_name": "Last",
"title": "",
"email": "email",
"email2": null,
"email3": null,
"mobile_phone": null,
"address": "",
"address2": "",
"city": "",
"state": "",
"country": "US",
"zipcode": "",
"notes": "",
"outbound_number": "",
"tos_accepted": "",
"password_is_temporary": false,
"date_activated": "",
"date_updated": "2",
"time_zone": "",
}
I’m not super familiar with the code I would need to make this happen.
Thanks!
I’m assuming your results is an array of objects like you posted; & your action somehow resulted in all of them being created, or otherwise creates a context in which a user may need to use all of that data in subsequent steps in their workflow?
One thing I think you could do is something like
return {line_items: results};
You’d have a proper object, and you’d have a way to reference the array of items. The limitation of this approach is that to use those results, any subsequent action step will need to explicitly support “line items”, ie expect and handle an array. Or the user would have to set up a workflow with our somewhat experimental “looping” app - not super straightforward for non power users.
Thanks for the responses, I answered my own question. Unfortunately, it was a mistake with the action where I selected Create instead of Search, so it was looking for an object instead of an arrayof objects.
Thanks again!