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

Question

Question

Sending Form Variables to Workflow

asked on May 27, 2021

I found the below thread about passing form values to workflow. It was pretty helpful, but it says to point the Retrieve Field Values field to the forms server. I am working in Cloud, so I don't have a forms server to point it to. I pulled in the assign field values field, but I need to figure out how to pass those variables on so I can pick them up there. I'm only finding the option to retrieve template metadata fields in the Retrieve Field Values task. Thank you for your help!

Amanda

How do I take a value in a form and then call a workflow, passing the value from the form to the workflow? What must be done in forms and what must be done in workflow?

Answer

Chris Ayre / VAR  1439  2 • replied on March 13, 2018

Two steps.

1.  After your form submit, send it to a workflow task in the forms process (need to enter the workflow name)

2.  The workflow you call from forms has to start with a Retrieve Business Processes.  Point it to the Forms server and then the specific process.

0 0

Replies

replied on May 27, 2021 Show version history

Amanda,

It is a bit different in Cloud.  I would start with the workflow.  First make sure you check the 'Allow this workflow to be started by other processes' in the workflow properties.

You will configure the workflow input parameters here as well.  Click on the 'View Parameters' link to open the parameter dialog.

Click on the 'Add Input' link to begin adding input parameters.  In my example I an passing an EmployeeID and BusinessID value to the workflow from my form

Publish your workflow then return to your forms process and add a workflow Service Task to the process.  In the workflow service task select your newly published workflow in the 'Workflow Name' dropdown, then click on the 'Add Input Values' link to open the input parameters dialog and select all of the input parameters for your workflow

Back in the workflow service task configuration click on the '>' button to assign the field values from your form to the workflow input parameters.

0 0
replied on May 28, 2021

Thank you! I now see how to connect the values to eachother, and that is working. However, in my workflow parameters, for the default values, I am only seeing global values:

I think this might be because the fields I am trying to pass on are multivalue fields. So, in the workflow service task for my business process I selected multiple tokens separated by commas. My guess is this is not the way to do it. Do I need to remove the commas? Create an input value for each individual token? Any ideas? 

Thank you for your help! 

0 0
replied on May 28, 2021

Amanda,

Unless I am missing something you wouldn't be setting default values for the workflow.  The values that the workflow will use will all come from the form or forms process itself and be set in the workflow Service Task as input parameters for the workflow.

Does that make sense (or can you provide additional feedback on why you would want to set a default value versus setting the values from the forms process)?

I also see that you have a workflow input parameter named 'EntryID'.  What is your  thought process behind that parameter? 

0 0
replied on May 28, 2021

So..... the business process is actually started from the workflow. I am passing on the entry id because we are imbedding the document that starts the workflow in an iframe on the form. The business process splits the form between multiple departments and then brings the information requested of them into one combined form. The part I am stuck on is passing the variables for information provided by each department back to the workflow so I can use them to populate the template metadata. So there is some back and forth. The information I am trying to pass on is the departments, GL codes and amount of money they are approving. So in the business process service task I created department, GL codes, amount, etc., then put all of the variables pertaining to that category in the input values separated by a comma, like so {/dataset/Clerk_Amount_1}, {/dataset/Co_Dev_Amount}, {/dataset/IS_Amount_1}, {/dataset/Lib_Amount_1}, {/dataset/Parks_Amount}, {/dataset/PW_Amount_1}. I haven't tried this before with multivalue fields. It does not look like they are showing up as options in the workflow default values so I am wondering if I need to create an input value for each variable instead of lumping them all into one? 

Hopefully that makes a little more sense.

0 0
replied on May 28, 2021

Further clarification, I am trying to populate the template metadata on the starting entry,  not the form document. That is why I have to pass it back to workflow.

0 0
replied on May 28, 2021

So my thought would be that yes, you would have to create an input parameter for each form variable instead of trying to pass multiple values in a single parameter.

0 0
replied on May 28, 2021

OK, I'll give that a go. Thank you for your help!

0 0
replied on June 2, 2021

On the business process side I added all of the token values for the input values.

However, in my workflow I still can only see the Global values when I go to set the default value. Any ideas as to why the token values are not transferring from the business process back to the workflow?

Thank you!

Amanda

0 0
replied on June 2, 2021

Like Cliff was saying, I'm not sure we're getting what you're trying to do. Forms will set the values for the input parameters when it starts the workflow. You already set those on the Forms side, what are you trying to accomplish with the default values on the WF side?

0 0
replied on June 2, 2021

An invoice is dropped into an incoming folder.

The invoice coming to the folder starts the workflow.

Workflow captures entry ID.

Workflow starts form, passing on the entry ID to use in an iframe in the form.

Form process runs through, collecting GL codes and amounts from various departments.

What I am then trying to do is pass the departments, codes and amounts values BACK to the workflow where the workflow can continue running, using those token values to automatically populate the metadata fields. I will then run a weekly report based off of the metadata.  

I've set the workflow parameters, and then populated the values with the correct variables from the form that I want to pass on, but those values are not showing up as choices as values in the workflow. Do I need to assign them as tokens first? 

0 0
replied on June 2, 2021

Forms can't pass data to a running workflow instance. It can only start a new one and pass parameter values. Workflow does not have access to Forms variables, the variable values are passed into the the workflow input parameters at run time. If you set up the WF Service task on the business process side, you're done.

 

Default values for input parameters are meant for the case where whatever starts this workflow does not pass any values.

replied on June 2, 2021

Let me see if i have this right. You have a workflow that calls a business process and waits for that business process to return values. You are trying to set input parameters for this workflow using tokens returned from the Invoke Business Process activity. Is that correct?

If that's the case, that wouldn't be possible because at the time you're setting parameters, the Invoke Business Process activity has not run yet. You can, however, add an Assign Token Values after the Invoke Business Process activity and modify the input parameter values using variable values returned from the form.

0 0
replied on June 2, 2021

I kind of thought so, so I went ahead and did that. Now I am assigning field values for the template.

When I go to save I am receiving this error message.

Not sure what that is about.

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

Sign in to reply to this post.