I don’t think you need a script for this.
Assuming that I understand correctly, here is how it can be done:
- In table A:
- create a template column that concatenates the values of each column you need to use to compare
- In table B:
- create a similar template column as per table A
- In your Glide Form:
- create User Specific Columns to temporarily store the input values
- create a 3rd template column to concatenate these values. The format should be identical to the template columns you created in Table A and Table B
- now create two relations. One joining to Table A (call that rel-A), and the other joining to Table B (call that rel-B)
- if rel-A is not empty, you have a duplicate of a row in Table A
- if rel-B is not empty, you have a duplicate of a row in Table B
- the logic to decide which tables to write to based on the state of the relations can be handled within a custom action sequence