Script for for to compare

Hi there!
I need to create a script for to compare two tables. If the value in the table rows matches, then the script will notify the user. Where can I read about it?

Youā€™ll find examples of various scripts in this thread.

How would the user be notified - email?

As an alternative to scripting, Iā€™d recommend also checking out automation tools such as Zapier or Integromat.

No, push in app

So on adding a new row to table A, if it matches a row in table B then it should notify the user and vice versa?

Push notifications will not work on IOS, and will only work under very specific circumstances on Android.

2 Likes

I thought this was the wrong algorithm. better like this: the script compares two tables, and if there is a match (exact or in the period), then it copies the row to the third table, and a notification is already received from there

Then what I would do is create 2 custom forms for the addition of rows to two tables.

In those forms, writing to user-specific columns, I would have a relation to check if:

  • When I add to table A, if the input info matches a row in table B, write both to table A and table C, and show an in-app notification. If no, only write to table A.

  • Same for table B, if the input info matches a row in table A, write both to table B and table C, and show a notification. If no, only write to table B.

2 Likes

How to do it?

Where are you getting stuck with it? How are you currently letting users add rows to each sheet?

while also
function moveRows()
{ var sheet = SpreadsheetApp.openById(ā€œidā€);
var sheetname = sheet.getSheetByName(ā€˜Feedā€™);
var sheetname = sheet.getSheetByName(ā€˜Alarm-listā€™);
var sheetname = sheet.getSheetByName(ā€˜Notificationsā€™);
var rng = sheet.getRange(ā€˜A1:Z200ā€™);
var rngA = rng.getValues();
Logger.log(ā€œCheckā€);
}
}

Can you go through what that function specifically does in your case?

Writhe here Scripts, scripts, scripts! - #142 by Antonoff