You are viewing limited content. For full access, please sign in.

Question

Question

Best way to get current user's email

asked on April 22, 2018

I have a field that has a default value of the user's email address. I thought I could use javascript to clear the value on the previous form so that the default would re-populate the user's email address. 

What is a better way to get the user's email address every time a form opens? I have a lengthy process with many forms and steps. 

Ultimately I need to ensure that the current user cannot approve their own form. I am comparing the email address of the current user to the employee's email address on the form (lookup). 

Any other ideas are welcome!

 

Thank you in advance!

0 0

Answer

SELECTED ANSWER
replied on April 22, 2018

Hi Chris,

You can set the current user's email token on form description or text above/below field, so the value would not be submitted during runtime.

Then everytime you open the form, the token would show with the current user's email.

2 0

Replies

replied on April 22, 2018 Show version history

I think there should be section where the employee with all of his/her details including email address which are also the ones needs to be approved be on one sections, And for each staff who approves can have his/her own section with current user's email populated. Then you will compare employees email and current user email to accomplish what you want.

 

1 0
replied on April 23, 2018

Beautiful! I forgot about that little trick. I then compare the .text() of the custom HTML field to the .val() of the email field. (in case helpful to others).

 

Thanks again Rui!! Hope the weather on the other side of the world is nice!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.