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

Question

Question

Prefill URL from one form to another when using task in Progress ID

asked on November 5, 2020 Show version history

Hi,

My use case scenario in detail:

  1. Start a process and then on a certain stage I have HTML with Embedded URL to go to another Forms process then prefilling some fields. 
  2. When I click on the link, it opens up the new Form in the same task where I start another process.
    1. I have a field on the 2nd Process (Form) where I prefill a field with the starting Process URL existing task.
    2. Once this task is done, I have set the Redirect to open the existing task 1st Process (Form) https://FormsServer/Forms/form/approval/5cbd258a-d78c-4c9f-b28f-3b056a1e0835?hideHeader=true

My question is, can I, in the link above which is the Existing Approval task add prefill data in the URL?

 

https://FormsServer/Forms/form/approval/5cbd258a-d78c-4c9f-b28f-3b056a1e0835?hideHeader=true?Name=Something

0 0

Answer

SELECTED ANSWER
replied on November 26, 2020

Actually Forms already support passing values for variables in URL for user task already, it is just turned off by default, you need to add " LFInternal.AllowUrlLookupOverride = true;" in the JavaScript for the form used in user task as following to turn it on:

We will turn it on by default in next release.

1 0

Replies

replied on November 5, 2020

You can only prefill data in the URL for the field variable not used in the forms for the steps before the User Task. For example, there are two steps: message start event (use field variable A), user task(user field variable A and field variable B), you can prefill data for field variable B at user task step but not for field variable A. The reason is prefill data in the URL only support field variable with no data, if the field variable is used in previous steps, there will be data for that field variable(no matter it is blank or not) and the data from previous steps has higher priority then the data prefilled in the URL.

1 0
replied on November 5, 2020

Thanks Xiuhong, I guessed as much but was not sure. Other alternative, I am letting workflow saving the values to a SQL table then doing a lookup with the value I require.

 

First Form instance ID as unique value and then saving the data to SQL, then when the form loads doing a lookup, but most of the times then the task is opening before the data has been saved to SQL therefore I was considering other options. Not sure if I can trigger lookup after form has loaded to fill the field with the value as needed.

0 0
replied on November 5, 2020

When a form is loaded, it won't automatically run lookups to fill fields that are already filled (under the assumption that you have already filled those and wouldn't want to change that value). However, if you trigger the lookup after the form is loaded by changing a lookup input or using JS, it will run and overwrite an existing value. 

0 0
replied on November 5, 2020

What is your use case of having two processes like this? Why not just use a user task where the user can update the data from within the instance? You shouldn't need to collect data in another process and merge it back in. 

0 0
replied on November 5, 2020

The use case for this process is the following:

We have a lot of processes, some are dependant on a certain process to happen in order to give us a desired outcome or value. These used to be excel sheets. So for instance, process 1 does all the collection of information and then it goes to process 2 where other set of data does the calculations etc, but Process 2 is being used in multiple processes in different jurisdictions and it is also being used individually.  So for us, designing a process which could be used across the board and individual was easier and more effective where we would need to build Process 2 into each Process.

 

Using the Instance ID of the Form, we save the values into SQL with the Result/Value pulling back into the process starting Process 2.

 

Hope this makes sense.

0 0
replied on November 9, 2020

We will investigate why pass value in URL only works for variable never used in previous steps. It is expected to be able to pass value for variables in URL for user task as well.

0 0
replied on November 9, 2020

Thank you Xiuhong, that will be great. For now, I am using lookup rules and using Java to trigger the rule which is working, but sometimes the user opens the existing task too quick and the workflow is not completed as yet.

0 0
SELECTED ANSWER
replied on November 26, 2020

Actually Forms already support passing values for variables in URL for user task already, it is just turned off by default, you need to add " LFInternal.AllowUrlLookupOverride = true;" in the JavaScript for the form used in user task as following to turn it on:

We will turn it on by default in next release.

1 0
replied on November 26, 2020

Thanks Xiuhong, this is awesome!

0 0
replied on April 15, 2022

The experience has been improved since Forms 11, you don't need to use JavaScript to enable passing values for variables in URL for user task any more, it has been turned on by default.

0 0
replied on April 18, 2022

Thank you for updating this.

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

Sign in to reply to this post.