Problems with creating uid in spreadsheets using zapier

Hello. This is my problem situation.

  1. The two Google Forms receive different data from users.

  2. Using zapier, combine the two data into one Google spreadsheet “A”.

  3. Each row of “A” needs a unique ID, so I wrote the script with the help of
    Google Sheets UniqueId Apps Script

  4. However, scripts do not work on data coming through the zapier.

  5. And unique IDs are also required for existing data, not new data. However, this script seems impossible because the trigger is ‘onedit’.

How can I solve this problem?
To sum up, what I’m asking is,

“I want to give a unique ID to the data that Zapier automatically puts in”.
“I want to give unique ID to existing data”.

I tried to solve this problem for a long time, but I couldn’t solve it. If you give me advice, I think it will be a great help. Thank you.

Welcome to the community.
I suggest you to ask for help on that post since your usage of both AppScript and Zapier makes your case a kinda niche one

[Google Sheets UniqueId Apps Script](https://community.appsheet.com/t/google-sheets-uniqueid-apps-script/30980) Tips & Tricks ?

Here’s a tip on creating unique ID’s directly in Google sheets with Apps script: The code works by scanning your sheet for edits in rows. If the edited row doesn’t have a ID in a set column (aka empty), it creates one. This code does not add unique ID’s to empty rows, or change the unique ID if the row is edited. Note that the unique ID doesn’t go away if you delete all other information in a row. Open your sheet and add a column with a header name with for example “ID” Go to Tools → S…

angk34:

And unique IDs are also required for existing data, not new data. However, this script seems impossible because the trigger is ‘onedit’.

Use onChange() instead.

https://community.appsheet.com/search?q=onchange

2 Likes

You’re right. I’m not familiar with the rules of this community. Thank you.

1 Like

Thanks, I solved one problem thanks to you.

1 Like