Change Process Data Variable Values
To change process data variables in your process, do the procedure in this topic.
Video: Add Conditions and Salesforce Actions
Examples
- (Example) Configure the Update Process Data Activity
- Examples - Step-by-step use case examples, information about what types of examples are provided in the AgilePoint NX Product Documentation, and other resources where you can find more examples.
Good to Know
- In most text fields, you can use process data variables as an alternative to literal data values.
- You can configure whether this activity waits for other activities before it runs.
For more information, refer to How Do I Configure an Activity to Wait for Other Incoming Activities?
How to Start
- On the Application Explorer screen, do one of these:
- Do one of these:
- Add an activity:
- In the Process Builder, in the Activity Library, open the Common tab.
- On the Common tab, drag the Update Process Data activity onto your process.
- Change an activity:
- In your process, double-click your activity.
- Add an activity:
- On the Update Custom Attributes screen, click Update Custom Attributes .
Procedure
- On the Update Custom Attributes screen, complete these fields.
Field Name Definition Process Data Variable
- Function:
- Specifies the name of the process data variable that stores the return value for your code snippet.
- Accepted Values:
-
- A process attribute.
At runtime, if the process attribute does not exist, a new variable is created and the value is assigned.
- An Xpath to an XML schema element.
At runtime, if the schema element does not exist, the process ignores the action. If you want to change a repeatable XML element, make sure it exists in the schema.
- A process attribute.
- Default Value:
- None
- Accepts Process Data Variables:
- Yes
- Example:
-
- Process attribute variable - EmployeeName
- XML process variable - /pd:myFields/pd:empName
Also refer to:
Expression
- Function:
- Specifies a value your code snippet gives to the process data variable.
The Expression field can not be blank.
- Accepted Values:
- Behind the scenes, the value in the Expression field is converted to
complete this C# phrase:
ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = {Expression field value};
As such, it is possible to have several different types of values, but in most cases, they must follow C# syntax.
You can use any of the types of values in this list.
A literal string value.
- The string value must be enclosed within the quotation marks (" ").
- The string must be in valid C# string format, which means no special characters that would cause the string to be misinterpreted as C# code.
Examples:
- "Mary Poppins"
- "8675309"
Behind the scenes, this creates C# code that looks like this:
ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = "8675309";
A variable.
If you use a variable in the Expression field, it initializes, or sets, the value of the variable in the Process Data Variable field to the current value of the variable in the Expression field when the Update Process Data activity runs.
- You can use process data variables in either of these formats:
- Process data - ${EmployeeName}
- Xpath - ${/pd:myFields/pd:empName}
- Do not enclose variables with quotation marks (" ").
Behind the scenes, this creates C# code that looks like this:
ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = ds.Attr("/pd:AP/pd:myFields/pd:empName", pi, w);
A C# code snippet.
This is advanced functionality, and knowledge of the C# programming language is required. AgilePoint does not provide detailed documentation on how to use C# code in general. These are rules to understand if you already know how to program with C#. If you would like help with this feature, please contact AgilePoint Professional Services.
- Any .NET methods must be available in
one of these namespaces:
- System
- System.Collections
- Ascentn.Workflow.Base
- If you use variables in the C# snippet, they must obey these rules:
- You can use either AgilePoint formatting or standard C# formatting.
For example, you can use the format ${EmployeeName} or ds.Attr("EmployeeName", pi, w);
The same as when you use only a variable in the Expression field, if you use the AgilePoint variable format, it is converted to C# format behind the scenes.
- Your C# code must use type casting for the variables.
- You can use either AgilePoint formatting or standard C# formatting.
Example:
(${/pd:AP/pd:formFields/pd:employee1}).ToString().ToUpper() + " and " +(${/pd:AP/pd:formFields/pd:employee2}).ToString().ToUpper()
In this example, the values of employee1 (Poppins) and employee2 (Van Dyke) are converted to all capital letters (UPPER CASE). It also combines both values with the word "and". This is the result: POPPINS and VAN DYKE.Behind the scenes, this creates C# code that looks like this:
ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = (ds.Attr("/pd:AP/pd:formFields/pd:employee1", pi, w)).ToString().ToUpper() + " and " +(ds.Attr("/pd:AP/pd:formFields/pd:employee2", pi, w)).ToString().ToUpper();
- Default Value:
- None
- Accepts Process Data Variables:
- Yes
- Example:
- Refer to:
- To validate your code, click Verify .