Design > Using and Displaying Data > Setting Source Values
  

Setting Source Values

You can tell Guide Designer about the source of the values that will be assigned to a field. The following figure shows part of a Create step where fields have different sources:

Setting Source Values: Content

A Content source is one in which the person designing the guide is deciding the value that is passed as input to a step. For example, you could use Content to set the Description field of a Create step creating an event to "Demonstrate the product" rather than requiring the guide's user to provide the description.
Sometimes, you want to create content that contains text and field values. For example, you could have a "mailing" field that contains a person's name and address. You would add this information by including field strings.
Click the (x) icon to see a list if fields.
After you select a field, Process Designer places a field code into the text box at the cursor's position. You can individually select as many fields as you need; however, you can only select one item at a time.
Here's an example:
You can also add text to this inserted field indicator. For example, In front of {$Account.name}, you could type "Name: ".
When Process Designer executes this step, it replaces each field indicator with the text extracted from the field.

Setting Source Values: Field

If you select Field for the Source, Process Designer displays a collapsed list to the right. You can now select the field whose value Process Designer will write into the object when this step executes. As with other places where you select fields, the bottom of the picklist may show related objects whose fields can be used.

Setting Source Values: Formula

Fields that take numeric input fields can use a formula to set a value. For example, you can use this with the Assignment step to add a number to an existing field. Use numeric operators such as +, -, *, div, and mod to perform an operation upon fields.
You can also use any XQuery function within a formula. (These are defined at http://www.w3.org/TR/xpath-functions-30/.)

Evaluation Notes

Process Designer evaluates formulas as you might expect. Note that:
For information on available functions, see Using Functions.

Setting Source Values: Query

Use a query to retrieve object information from all of the objects that are selected by the Where Clause.
Query controls appear in different steps and in some dialogs so what you may see may differ slightly.
What you will be doing is creating an SQL WHERE clause. While you can enter your condition directly into the text area, it is usually far easier to click the Add Condition button and the Order By picklist. After Process Designer inserts this information, you can edit it if you need to. Letting Process Designer do the work is recommended as it is sometimes not obvious what the field's internal name is. The text entered here is a standard SQL WHERE clause. Also, this text does not include the WHERE keyword.
Each condition has four parts:
Pressing the Order By picklist button lets you select the fields that the query sorts upon when it displays information. For example, you might want to sort the displayed information by a person's last name. You can add additional keys by reselecting a field from this picklist. The Order By clause is placed within the text box. This lets you edit it after it is inserted. You can also directly type the Order By clause here as well.
Note: You can add an SQL LIMIT clause to your query by entering it in the Where clause text box. For example, you can limit the number of retrieved rows to 200 by typing "Limit 200". When adding this clause, be sure to add a space after the where information or place it on its own line after the where. ("Limit" can be in upper, lower, or mixed case.) By default, 100 rows are returned. If your guide requires more than 100, you must add this clause.

Specifying Conditions in a WHERE Clause

Your ability to define a condition within a WHERE clause depends upon what Produce Designer is interacting with.
Direct Interaction with a Relational Database
Most databases fully support the SQL WHERE operator. If you encounter problems, you should consult the documentation for that database.
Using an Informatica Connector
If you need more than one condition, only simple cognations (field operator values) are supported. You may join multiple conditions using either AND or OR. You can also use the NOT operator to invert the meaning of the condition.
Salesforce
The WHERE condition must conform to SOQL requirements. Consult the Salesforce SOQL documentation for more information.

Using a WHERE Clause When No Answer Is Expected

One common situation, and a situation that isn't at all unique to Process Designer, is that you are creating a WHERE clause that is based on a multiple criteria. However, not all of the criteria will have values. For example, an account and a territory, and the territory is optional. Setting up a WHERE clause such as Account={$account) AND Territory={$territory} wouldn't work if no territory value was used.
The solution for creating a WHERE clause with fields that are optional is to use the LIKE operator; for example, Account LIKE '%{$account}%' AND Territory LIKE '%{$territory)%'. If territory doesn't exist, this would be the same and entering Account LIKE '%{$account}%' AND Territory LIKE '%%'. The LIKE following the AND will always evaluate to true.

Setting Source Values: Screen

If you select Screen for the Source, the end user provides data for this field. This means that you must add a field to the step's Input Screen tab so that the guide's user can type information. In the following example, the source on the Input tab for three fields was set to Screen:
Note: The text you enter will look better if placed in tables.
Like all fields, you can click within it to display a properties dialog.