Pre-fill signed-in user email in form

I’m using a helper row to capture data from an onboarding form. I would like to have an entry prefilled with the users email, since they’ve already entered it, but I can’t figure out how to capture it. I found this comment from a couple of years ago:

Hi @Harsh_vardhan :wave:

You can add the User’s email special value.

efre

Thank you

However, I don’t see those special values as component options. I’m assuming things have changed. I’m sure this is a possibility, but I can’t figure out how to do it.

Guidance?

If you don’t see those Special Values, then it sounds like you’re using a Custom Form.
Regardless, if a User is already signed in, then there is no need to try and capture their email address again, as you already have it in their User Profile row.

Question: what happens when the user has finished with this onboarding form? Is there a button with an action? Assuming yes, what does that action do?

Normally with an Onboarding screen you wouldn’t use a Helper Table/Row - instead you’d have your screen sitting on top of the User Profile row and write the values directly to that row.

It would be useful to see a screen shot of what you have, both in the Data Editor and the Layout.

@Darren_Murphy I I’m using a custom multi-step form. I followed the guide in this post, which seems to work pretty well.

The user row is populated at SUBMIT by the values from the helper row (which are all users specific), which also populates a public users table.

Not sure what to show you for the layout. Here’s the working version of the app:
https://beta-hf.glide.page

If I understand your comment, the helper row is an unnecessary step. I can write directly to USERS and then use that to populate PUBLIC USERS?

Correct?

I tried changing the source of my form from the helper row toUSERS. My entire form disappeared. That’s not good.

I think it’s because my form depends on a column called STEP that increments when I move to a new section of the form. So unless I’m going to completely redo the form, the logic of my form depends on that column.

Could you move that column to the user profile?

That might be a good solution. Honestly, I’m reluctant to mess around with the user profile because I don’t know what other impacts it will have on the app. But I guess I just need to try stuff and see what breaks, right?

Thanks for this idea. It might be The Simple Solution to my problem.

1 Like

I’d recommend duplicating the app first… just to be on the safe side

So you have a Users table, and a Public Users table to store those same users but just their public info?

Can you show me the action that’s attached to your Submit button?
I’m guessing that it does a Set Column Values in your Users Table, and an Add Row to your Form Submissions table?

Just taking a step back for a second - if I look at your Public Users table (which is labeled as Form Submissions), it appears as though it is more of a log table than an actual Public Users table. Is that correct? Can you explain the bigger picture here - what exactly is the purpose of the Form Submissions table?

Sorry for the questions, but details are important and I need to understand what you have and what you’re trying to do in terms of the bigger picture, before I try and give any advice. Otherwise I could end up leading you in the wrong direction. Please try and answer all of my questions. I suspect that your solution here could be very simple.

2 Likes

@Darren_Murphy Here’s the action:

From other posts, I thought it was good practice to not expose data from user table publically. That’s the point of the form submissions table.

I also thought that when someone signed in they automatically created a user row so my second action was designed to set values in that row. Clearly, I don’t understand that process.

The mail action is just a notification whenever someone registers.

The final action clears the helper row and sets the counter back to one for the next person.

The form seems to work well as far as collecting data and filling in the form submissions table, but it doesn’t put anything in the user’s table.

Please tell me if I’ve answered all your questions. I really appreciate your help.

You shouldn’t be adding rows to your Helper Table - it should only ever contain a single row.
All columns in that table are user specific, which means that different values are stored for each user.
So you should remove that Add Row Action. It’s not required and will cause problems.

With the Set Column values in the User Profiles table step - when you test, are you “Viewing as” an actual user that already exists in the User Profile table? If you are not, then that step would be expected to fail. So please check that. eg. it won’t work if you are viewing as “anyone”, because “anyone” doesn’t have a user profile row.

Your final action isn’t required. As each user should only ever see this form once, there is no need to reset anything. (unless you are testing over and over again as the same user).

2 Likes

I think I got it sorted. Your guidance has been extremely helpful.

I’ll have some friends test it, but I MIGHT be ready to begin refining it.

Thanks very much. I’m sure you’ll hear from me again.

2 Likes