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

Question

Question

Get user that lands on a form in a certain stage

asked on March 3

In our business process, we use the same form in two different stages. Is there a way to save the current user variable that uses the form in the later stage but not the earlier stage? The way that I've attempted this is to create a variable with the default value of "currentuser_display". But once it gets set in the first stage, it won't be set again when the form is used later on.

I've tried to use field rules to hide and not save data when it's in one stage, and hide but save data when it's in another stage. But it didn't apply the rules since two rules were applying to the same field. 

Does anybody know the best way of going about this?

Thank you.

0 0

Answer

SELECTED ANSWER
replied on March 3

One option would be to use a workflow and override the field's value using a workflow. If you set the workflow properties to enable Started by Laserfiche, you can use the Set Business Process Variables activity and get the latest submitter.

 

I use this method commonly, when I want to save/override who approved a form at a later step.

0 0
replied on March 6

This looks like it could work, thank you!

0 0

Replies

replied on March 3

Hi Orion,

Seems like you want to save the current user that opens the form every time it's opened and saved, and in next task, it still gets the current user, not previous one. If that's the use case, I think you are very close to make it using the field rules, here are how I make it work.

1. Prepare two single line fields, first one will set default to "currentuser_display", and is always hidden by field rule and ignore the data, second one is not hidden, and no default value on it.

2. In the javascript code, add the below line
 

$(document).ready(function(){
                  $('#q2 input').val($('#q1 input').val());
                  })

here q1 is the hidden field, q2 is visible. This script will set q1 value to q2 everytime the form is loaded. So the trick is everytime your form is loaded, it first set the hidden field with default value "currentuser_display", then the script will set the same user to second field. When you submit the form, only second field value can be saved. Next time the form is loaded from second task, the hidden field is populated again, thus the current user for second field. You can make the second field readonly and hidden but save data so that it can only be modified via script.

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

Sign in to reply to this post.