Best answer

How to Read array data from api and save it in spread sheet.

  • 14 October 2020
  • 1 reply
  • 164 views

I am new to zapier , i want to automate a business use case through  zap , I want to fetch array data from our api → save it to spread sheet → and then send that spread sheet to customer  on daily basis through email.

I am able to get data from api in array form through action and trigger

[
  {
    "product_name": "Aircall",
    "id": "188a9d17-3a55-4828-b2d0-a6d200b2a87f"
  },
  {
    "product_name": "Bloomerang",
    "id": "84d7de7a-e4b1-4600-b443-a6d200b2ee7a"
  }]
but when i m creating a zap for spread sheet this data is showing in the form of objects . i m able to insert only 1 row in spreadsheet.

Please help me to resole this .I want to store data in my spread sheet in the below format

 

icon

Best answer by Zane 14 October 2020, 16:10

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +9

When your integration is returning an object that has an array, we refer to that as “line items”.  The action that the user maps your fields into needs to be written to expect an array as input.  For instance Google Sheets has a special action for line items, and you’d want to us that one:

 

 

Also, assuming this is an action, I think rather than returning a bare array your action will also need to wrap it, so you’re returning a single object.  

 

{“products”:[...]}

 

Which raises a question… Might this use case be better served as a trigger?  So you just send the Zap new products whenever they are added/created?  No need for line items, and your bare array would be bang on perfect.  Each item in the array will trigger a separate Zap execution, handling an individual product.