Update Process Data activity

An activity that updates the values of specified process variables.



Change Variable Values

To change the values for your variables, do the procedure in this topic.

Video: Add Conditions and Salesforce Actions

Video: Configuring Process Data

Good to Know

How to Start

  1. On the Application Explorer screen, do one of these:
  2. Do one of these:
    • Add an activity:
      1. In the Process Builder, in the Activity Library, open the Common Common icon tab.
      2. On the Common Common icon tab, drag the Update Process Data Update Process Data icon activity onto your process.
    • Change an activity:
      1. In your process, double-click your activity.

Procedure

  1. Complete the fields on the General Configuration screen.

    For more information, refer to Configure General Options for a System Activity.

  2. Click Update Custom Attributes Update Custom Attributes icon
  3. Set process data variables whose values you want to change a variable on the Update Custom Attributes screen.

    For more information, refer to Change Process Data Variable Values.

  4. (Optional) Click Advanced Advanced icon > E-mail Notifications E-mail Notifications icon.

    For more information, refer to Configure E-mail Notifications for Any Activity.

General Configuration

Specifies the common information for a system activity.

Screen



Fields

Field Name Definition

Display Name

Function:
Specifies the activity name that shows in your process.
Accepted Values:
One line of text that can have spaces.
Default Value:
None
Accepts Process Data Variables:
No
Example:
Refer to:

Description

Function:
Specifies an optional text description for your activity.
Accepted Values:
More than one line of text.
Default Value:
None
Accepts Process Data Variables:
No

Update Custom Attributes

Connects process data variables to C# code snippets to update the variable values.

Screen



Fields

Field Name Definition

Add Add icon

Function:
Adds a new process data variable.

Validate Validate icon

Function:
Compiles the code snippet to validate the variables, and displays an error message if necessary.

Delete Delete icon

Function:
Deletes the selected row from the variable list.

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.

Default Value:
None
Accepts Process Data Variables:
Yes
Example:
  • Process attribute variable - EmployeeName
  • XML process variable - /pd:myFields/pd:empName

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.

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