Learning Salesforce Visual Workflow and Process Builder(Second Edition)
上QQ阅读APP看书,第一时间看更新

Adding values to a collection variable

You can't refer to your collection variable either in the Record Lookup or Fast Lookup element to populate it with values. The following are a few ways through which you can populate values in your collection variable:

  • Screen fields: Using an Assignment element, this allows you to populate values for a collection variable by referring to Screen fields such as Choice, input, or output field values. You can also populate values for a collection variable by referring to values stored in a variable using an Assignment element.
  • Variable: This also allows you to populate values for a collection variable by referring to values stored in a variable using an Assignment element.
  • SObject Variable: Using an Assignment element, this allows you to populate values for a collection variable by referring to one SObject Variable field value.
  • SObject Collection Variable: To assign SObject Collection Variable field values to a collection variable, you have to use a Loop element. Within the Loop element, using an Assignment element, you can populate values for collection variables by referring to the Loop variable's stored field values.

In Chapter 3, Manipulating Records in Visual Workflow, you will learn how to populate values for a collection variable.