Add a value in relational field without erasing the previous ones

Hi all,

Im currently working on a project where I need to be able to, by the click of a button, add a value in a list of values in a relational field, without erasing the previous values in this field.

For example :

I have a relational field who link all my users who clicked on a button

Currently on that field I have : User A, User B, User C

I would like that, if User D click on the button, it will add User D on this list in the relational field

But currently when I click on the button, it erase all the previous values of the list and only add User D

So I end with only User D in the field and not User A, B, C, D

I would like to know how i can do that ? Thanks in advance !

I think you’ll first need a Lookup column to retrieve the list of existing users from the relation. Then you will need a template column to join the lookup column with the new user. Finally write the template value back through the relation.

I made the lookup column but in the template one I can’t find it in the list of the ā€œreplacementā€ section, I can’t see the lookup column, same for relational column

That means either your relation is a multiple relation, or your lookup column is not pointing to the relation.

Do you expect your relation to link to multiple rows, or should it only find one matching row? Do you have the ā€˜multiple’ checkbox checked in the relation?

Yes my relation is a many to many relation (a user can click on differents actions, and the action can be clicked by differents users)

So I want my relation to link :

  • On the users table : All the actions the user clicked
  • On the actions table : All the users who clicked on that action

Considering that the ā€œclickā€ on a action is done by a button

You can’t do a Set Column action through a multiple relation, so I’m a little confused how you are currently getting your user value to overwrite an existing value. Also, if your Relation and Lookup results in an array of multiple values from multiple rows, how are you expecting to update a single row?

I need some more information and preferably some screenshots to get a better idea of what you are trying to do. Maybe you should be using a Joined List column instead of a Lookup column, but I don’t have a good visual to say for sure.

To explain my project in a more general way :

I would like to have a app where users can see a list of actions to do, and for each of these action he can vote ā€œyesā€ or ā€œnoā€. When he vote a action it dissipear from the list and appear in another list ā€œactions you have already votedā€. And outside of that the possibily to make statistics for example the pourcentage of people who voted yes or no, ect…

My project is currently linked to a Airtable database :

When I click on ā€œvote yesā€ or ā€œvote noā€ it launch a webhook who launch a Make scenario who update the Aitable relation field in the right way. The problem is the 3 minutes delay between Airtable and Glide update that broke totaly the user experience, so i would like to make this update directly between Glide and Airtable, without using Make, so the update in Glide would be visible immediatly.

Actions Table :

User Table :

The two relation column that interest us are the ā€œVotes positifsā€ (who link all the user who cliked on the ā€œyesā€ button) and the ā€œVotes nĆ©gatifsā€ (same for the ā€œnoā€ button)

I would like, when I click on the ā€œyesā€ button for example, that my user is added to the list of the ā€œVotes positifsā€ of the action, without erasing the users already in this field

OK, lets focus on Charlie. Charlie votes Yes for Action 1. What happens when you click on the Yes button. Where is it writing a value? I think I’m still missing something because I’m not understanding how your relations are configured and I don’t understand where you are writing a value, or what value you are writing when they click on a button.

Actually when Charlie click on ā€œYesā€ for Action 1, it launch a webhook linked to a Make scenario who will get the current list of user in ā€œVotes positifsā€ for Action 1, add Charlie in this list and update the ā€œVotes positifsā€ with this new list. It work fine outside of the 3 minute delay to see it in Glide

OK, I think I might be starting to understand. Your relations are actually Airtable Linked Records, correct? I’m not overly familiar with Airtable, so I don’t know if I have a good solution for your existing setup.

Normal relations in Glide do not contain values like a Linked Record does. Normal Glide Relation usually link a separate column in the table to a column in another table. That doesn’t seem to be your case though. Linked Records are a little different because they serve two roles instead of one. Not only do they establish a relation, but they also hold the values used to establish that relation.

Since I don’t have any experience with Airtable or Linked Records, I don’t know how to help with your current setup. I guess what I would suggest would involve a separate basic column to hold your comma delimited list of users. Your button actions would use a template column to add a user to that list. Then you can use a Split Text column to convert the comma delimited list into an array, and finally, you can use the array when creating a glide relation between the user table and the actions table.

Linked Records in Airtable are an exclusive Airtable feature. Glide can work with them to some degree, but it’s a bit of a hack job. For example, a choice component can directly write to a Linked Record, but in normal cases, we would not do that. Instead we would write to a basic column and then create a relation based on that basic column value.

My first suggestion would be to not rely too much on Airtable exclusive features, and instead use Airtable purely as a database, but I realize that can be hard to do if people also Airtable with other integrates, or often work directly in Airtable.

I understand well that merging Airtable with Glide can sometimes be kinda hard to do.

Well I found a ā€œalternative solutionā€ for my problem : I stay with the actual process (webhook for a Make scenario that update the airtable base), and for ā€œsolveā€ the 3 minutes delay problem I found that Glide can have ā€œuser specificā€ fields. So i create a checkbox user-specific in the Actions Table.

Now when a user will vote, it will check this checkbox and, with a visibilty filtrer, directly hide from the list this action for this user.

1 Like

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