Change multiple rows column values in an other data table which matches one record from the other datatable

Hi again glide community,
somehow,( I think it happened during cleaning up my database, columns & resorting the rows and so on) I lost the functionality of the topics described function.

Let me explain the concept

Table A = projects
row id, project name, project creator, deliverydate, related tasks, address…

Table B = tasks
row id, related_row_id from_Table A, project name, tasks

If I change, with the edit screen, the project name inside of „Table A“ it should change all the corresponding project names in Table B which match the old/now new… project name from Table A.

In MySQL I would use an inner join…

I think it worked out with the single value-> whole row and the set column values action.

Because I‘m at the very beginning with glide (which is awesome and a beauty by the way :kissing_heart:) it could be that I have used several queries and lookups & function until it finally fitted my needs. :rofl: Hopefully you could show me a clean way how to re“nocode“ it​:wink:

Thanks
Alex

You need a relation in your Tasks table linking the ‘related_row_id’ to the ‘row ID’ in the project table. Followed by a lookup column to retrieve the project name from the relation.

Hi Jeff,
my tables look like this now:
Project:

Tasks:


image

the r.id_f_p (related id from project is not realy related…
I set the values when I add a task with the columns…
image

Everything correct until now?

How do I change the Project now only with scripts or with single value.

If with an action, then with the submit and not with the edit, because it already executes the script before the project was renamed, right?

Thanks
Alex

I’m not following what you are asking.

Then why is the r.id_f_p column value an exact match of the project’s rowID if it’s not related to it. Maybe I misunderstood what you meant by that statement. Of course it’s not the relation, but as I understand it, the value is the RowID of the project so it is associated with it, correct?

You already have the project name via the lookup column, which I trust is getting it from the relation. Why would you need anything else? If you change the project name in the project table, that change is going to automatically be reflected in the task table in the lookup column.

image

2 Likes

Hi Jeff,
oh that was easy… :sweat_smile:, I was thinking way to complicated :crazy_face:

thank you :+1: :muscle:, everything is working now!
Alex

1 Like

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