Question

Multiple Spreadsheet Rows with Json Array mixed data :( - NO LOOPING solution.


Hi everyone, 

I have an issue with one of my zap.
I call an API, with Webhook.

I got theses results:

items
1: 

     id: IDXXXXXXXXXX

     snippet:

          publishedAt: DATEXXXXXXXXXX

          description: DESCRIBE XXXXXXXXXX

          tags:

              1: TAG 1_ XXXXXXXXXX

              2: TAG 2_XXXXXXXXXX

              3: TAG 3_XXXXXXXXXX

items
2: 

     id: IDYYYYYYY

     snippet:

          publishedAt:DATEYYYYYYY

          description:DESCRIBE YYYYYYY

          tags:

              1: TAG 1_YYYYY

              2:TAG 2_YYYYY

              3: TAG 3_YYYYY

 

Then I insert ALL my data in a MultipleSpreadsheet.

So I GOT THIS:

Id publish description tag
IDXXXXXXXXXX DATEXXXXXXXXXX DESCRIBE XXXXXXXXXX AG 1_ XXXXXXXXXX,TAG 2_ XXXXXXXXXX,TAG 3_ XXXXXXXXXX, TAG 1_YYYYY, TAG 2_YYYYY, TAG 3_YYYYY
ID YYYYYYY dateYYYYYYY DESCRIBE YYYYYYY AG 1_ XXXXXXXXXX,TAG 2_ XXXXXXXXXX,TAG 3_ XXXXXXXXXX, TAG 1_YYYYY, TAG 2_YYYYY, TAG 3_YYYYY

 

There no Issue, for single DATA, like id, publishedAt or description

BUT 

When I insert my tags I got this: TAG 1_ XXXXXXXXXX,TAG 2_ XXXXXXXXXX,TAG 3_ XXXXXXXXXX, TAG 1_YYYYY, TAG 2_YYYYY, TAG 3_YYYYY

FOR EACH ROWS.

I should get for the first row TAG 1_ XXXXXXXXXX,TAG 2_ XXXXXXXXXX,TAG 3_ XXXXXXXXXX

an the second on  TAG 1_YYYYY, TAG 2_YYYYY, TAG 3_YYYYY

 

I put my data like this :

 

In fact the array [“TAG 1_ XXXXXXXXXX”, “TAG 2_ XXXXXXXXXX”, “TAG 3_ XXXXXXXXXX”],[“TAG 1_YYYYY”, “TAG 2_YYYYY”, “TAG 3_YYYYY”] is interpreted like this: 

“TAG 1_ XXXXXXXXXX”, “TAG 2_ XXXXXXXXXX”, “TAG 3_ XXXXXXXXXX”,“TAG 1_YYYYY”, “TAG 2_YYYYY”, “TAG 3_YYYYY”

I’m really lost.
I’have try so much things to solve this.
Formater, Code etc…

 

Do you have any clue?

Best regards.
 


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

10 replies

Userlevel 7
Badge +14

Hi @formation 

Check out the Looping app: https://zapier.com/apps/looping/integrations

Thank you for your help, but I’m looking for a solution WITHOUT looping.

I’m trying to insert hundreds of lines in google Sheet, which is why I don’t want to do a classic loop.
Otherwise I’ll decrease my quota for nothing.
With Google sheet you can easily insert 50 lines at once.
That’s what I’m trying to do.

I’m create multiple spreadsheet rows, in order to avoid looping.

My Zap is something that:

Webhook → API → JSON -> insert 50 —> Webhook A for the next 50 record

It’s a loop, but only every 50 records.…

 

Thanks for your help.

 

Userlevel 7
Badge +14

@formation

Are you using this GSheet action that has line item support?

 

When/how do I use the "Create Spreadsheet Row(s) (with line item support)" action?

You should use it whenever your trigger provides line items, so that the Zap can create multiple rows in your spreadsheet.
It's important to note that:

  • If one of the line items is missing a value that others have, we create a row with a blank value in that cell.
  • If you map a non-line item field to this action, but other fields have line items, it will copy the single value for every row added.

If your trigger doesn't provide line items you can use Create Spreadsheet Row action instead.

Thank you fo your quick reply.

Yes I’m using create Spreadsheet ROWS.
My Json is fine, and I can integrate all my result in rows and column..
But when the DATA is an array, all the data are mixed…

I think it’s because it’s a nested array.
 

The ZAP is like that;

Step3: I call an API and got a JSON result:
const res = await fetch ('https://wwwURL’)
const json = await res.json();
return json;
 

Step4: I integrate DATA in Googlle SpreadhShet.
Easy.

But when the data is in an nested array… it’s wrong.

I Have this: 

 

But in result, my rows are affected by val1,val2,val3,val4… All the value of the array.

instead of
Row1==> val1,val2
Row2==>val3,val4. 

Userlevel 7
Badge +14

@formation 

Yeah nested arrays are tricky and will likely need to involve the use of a Code step with custom code.

Huuum I see.

You mean I have to make a mapping between IdRecord and all nested array? 

 

Userlevel 7
Badge +14

@formation

Might be worth looking thru some of the related Topics on nested arrays: https://community.zapier.com/search?q=nested%20array

You’ll likely have to utilize either JavaScript or Python custom code to tease out the desired data points in the nested arrays and transform into a usable format.

Yep I see...

I don’t find already a solution in the community, but I will check again in the past Posts.

Thank for your help.

 

Userlevel 7
Badge +11

Hey @formation!

Since it’s been a while I just wanted to check in to see if you were able to find a solution here? Please let us know how you got on! :)