Not able to save the Http Request Body response to Google Sheet

Hi, I want to trigger workflow when new row Inserted, then it make a HTTP request with newly added value the then save that request response to new column in that particular row.

I am able to fetch column A value, make HTTP request, get response but when I try to use Update row or insert row action to save received http request body then I get error:

Cannot read properties of undefined (reading 'map')

I select the row: 1 for selecting Row Number. Does it auto select the new row number when a new row is added to google sheet. I want it always save the http response to corresponding row in next column.

Hi @joginder , Welcome to the community :wave:.

Right now, the Insert Row action doesn’t return the row number that you can use in the next step. But you can refer this solution from a community user to fetch row number from Insert row Action.

Let me know if you face any errors.

1 Like

Thank you for your reply, I just re-run the flow today and it woorks now and did not give any error, may be there was some error at server side at that moment. Now my problem is it update the existing column, but I want to add the http body response to next column.

Just do row number + 1 (if you meant next row)

@S_M thank you for your reply but this did not work. I get error: { "row_id": [ "Expected number, but found value: 1+1" ] }

You can’t add 1 directly, you’ll have to use code (not sure if there’s a simpler method, but this works)

First: add the Code action

image

Then add this specific code:

export const code = async (inputs) => {
  const result = inputs.number + 1;
  return result;
};

Make sure to also add your row number as an input, call in number

image

It should look something like this:

@kishanprmr Thank you, I am able to find the row number and supply to next step. I wonder can I set the columns also? I mean suppose regex give line number 5, then how can I set row number to “Row 5, Column B” to Update Row action?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.