Can't Use Field Values in Workflow


Badge +2

I created a simple workflow in the K2 Designer. If an "Approve" action is taken, I want to call a smartobject "Create" method that will create a record in SQL. The form being used has a view which holds the fields that the values will be pulled from. The probem is, when I add the create step to the workflow, the context browser does not give me the option to use these fields as input values. Any suggestions? See image below:

 

16226i75B8F704E846DE27.png


2 replies

Userlevel 1
Badge +8

Hi John

 

You can't reference the fields on a form unless you do one of 2 things:

  1. Save the form data to a SmartObject (e.g. A smartobject mapped to a SQL table)
  2. Pass the form values to the workflow as Data Fields when you start the workflow

For approach 1, you will need to call the Create method on the form and save the data before you start the workflow. Once you have done this you then have 2 options:

  1. Pass the ID of the new record created into the workflow as Data Field. You can then create a Reference in your workflow to the Read method of this same smartobject and get access to all of the properties
  2. Use the SmartForms integration wizard and get an Item Reference to the smartoject on the View.

For approach 2 you will need to create Data Fields in your workflow for each field you need and then pass these into the workflow when you call the start workflow rule.

 

I suggest you review some of the tutorials on http://www.k2.com/resources/product-demos on how to pass form data to a workflow.

Badge +2

Thank you so much, Andrew! Specifying data values on the start form did the trick.

Reply