How can i add row owners emails automatically?

I am currently adding row owner to protect private information currently in the data set but what happens when a user adds new information? They don’t add their email every single time they add info. Do I have to add an email field in the form which is really manual and risk having wrong email input or spelling mistakes or is there a way for user email to be added automatically every time they add data and i can make that column row owner?

Hi @Audrey_V :slight_smile:

Assuming the user fills out a form to add new values, you have at least two ways to achieve this in Glide. Let’s describe both options and briefly discuss their advantages.

1. Using Special Values or Valyes from User profile components

When building the layout of your form, you can add a component that won’t be visible to the user but will still automatically write a special value to a specific column - in you case, probably the user’s email address.

Among the viable components for this approch, let’s mention:

  • Email in Values from User profile
  • App user’s email from Special Values

Whichever option you choose, you just need to point your Row Owner column to that value and… voilà!
Each time a User submits the form, their email address is also added to the column where row ownership is applied.
Note that the form does not display this value. You can think of it as a hidden field pre-filled with the User’s email address - this might help you better understand the logic behind it :wink:

2. Trigger a Workflow when the user submits the form

You can also define what happens when a User submits a form via the On submit section. By default the action is Show notification.
You can change this by:

You’ll find the same options as before - App user’s email and User profile → Email values. Unlike the first option, here it’s not a component but the result is exactly the same.

Final thoughts

Both options are effective. I like the simplicity of using a component (option #1)… and I also like the clarity and traceability of using a workflow whenever a user action is involved (option #2), especially for documentation purposes.
You could even unsure it’s done twice by using a component and a workflow :smiley: (though that would be total overkill, so maybe skip that idea!)


Is this what you were looking for?

4 Likes

I would advise against option 2. Whilst it will work most of the time, occasionally it can be subject to a race condition where the Set Column values action fires before the new row has been created. When this happens, the Set Column values will fail. You can minimise the chance of this happening by inserting a short wait condition, but personally I believe it better to avoid this method all together. There is really no reason to use it when there are other, more reliable, methods available.

A 3rd option is to use hidden input components with default values in the form.

Personally I prefer your option 1. I consider it to be the correct and best approach.

4 Likes

I just came across this tip from @MaximeBaker available under Community Resources:

I haven’t tried it myself, but it’s clearly the simplest way to fill a Row Owner column as long as the prerequisites are met (e.g.: using the email address as the value to store in the column).


That makes perfect sense, @Darren_Murphy. Thanks for pointing it out :folded_hands:

2 Likes

Yeah, I was aware of that one, but I never use it. I can remember when it was first introduced there was a problem with it. If you were planning to use that column as row owner for roles, then Glide would override the role value with the users email address. I don’t know if it still does that, but it was a problem at the time.

1 Like

Thank you @Nicolas_Joseph and @Darren_Murphy option 1 works great!

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