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

Question

Question

Using _currentuser variable in Forms

asked on June 4, 2015

I'm trying to figure out how to get a single form to use the current user ID of the person opening that form after another person has already opened and worked on the form.

I've tried creating a field whose default is {/_currentuser}. However, once the first person opens the form, their user id is stored in it. When the next person opens the form, rather than his/her current user id being stored in the field, the first person's user id is still there. 

I need to have that field's default value still be {/_currentuser} so that the new user's id can be put in it.

Maybe I'm doing something wrong? The only way I can think of to accomplish this is to use javascript to overwrite the userid in the field with the string {/_currentuser}. 

It just seems there must be a better/easier way.

0 0

Replies

replied on June 16, 2020

Although this is old post, but I think I should post a better solution for this so that anyone reaching this looking for an answer may find this useful; The best way to keep a (dynamic) token as default value and keep that field refreshed on each form is to add a field rule that hides the field and use "Ignore the data when the field/section/page is hidden" option. This way it will not save the default value when submitted and the next time it will get an updated token value (for example current user).

If you want to show the field, you'd add another field and have it copy the value using advance/calculation setting.

3 1
replied on January 12, 2021

This was helpful - thanks!

1 0
replied on June 5, 2015
 
 

Hi Sheila,

 

Double check if the field on the second form is set to read only?

 

Another way to do this is on that second form, create a new field, and again use the default value of {/_currentuser}.

 

What's happening is the field is getting set on the first form, and then since you're using the same field on the second form, it's passing that data through instead of updating it.

 

Now you'll have two fields, the current user who did Form1, and the current user who did Form2.

 

Cheers,

Carl

 
1 0
replied on June 5, 2015

Hi, Carl. Thanks for responding.

The problem is that we're only using one form for several steps in the process and those steps can loop, depending on field entries. One of those steps sends the form to the current user, which won't necessarily be the same on repeat loops. That means even if I were to create another form, which I don't want to do because it increases the maintenance cost of the forms process, that solution would only work if the process went smoothly all the way through (no loop backs).

There's no way I can determine how many people will handle the form in a given instance, so I need to rely on one field that gets reset as it gets passed from user to user.

I can't believe I'm the only person who has a process like this, and am wondering how others worked around it.

1 0
replied on June 7, 2015

Ahhhh.... I found the way to do it. Rather than using a variable in the default setting, I'm using a lookup rule to populate the field.  When _(Current User) matches a column in our database, use that value in the field.

Thanks!

1 0
replied on June 8, 2024

Hello Sheila,
Please can you please post the steps on how to get this done here. It would really help me.

Thanks

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

Sign in to reply to this post.