Loading
Unified Catalog
Configure Flow Intake Forms to Prefill Context Attribute Values

Configure Flow Intake Forms to Prefill Context Attribute Values

Show existing context attribute values when requestors update their service catalog requests. Configure the intake form flow to retrieve and prefill the values.

Required Editions

Context attributes are variables based on supported Apex classes that you add to an intake form. When authorized users modify their requests by changing the intake form values, the Get Service Process Details action returns existing context attribute values in a nested structure.

Configure the update branch of the flow to use the returned values as defaults for the corresponding screen components. An attribute on the top-level node is a single value, so reference the action output directly. A child node is a collection, so use a loop and an assignment to store the attribute value in a flow variable.

  1. In Flow Builder, open the intake form flow that supports updates.
  2. Create a variable for each child-node attribute that you want to prefill. Use the same data type as the context attribute.
    To store the AccountNode_Name text attribute, create a Text variable named Output_Ctx_AccountName.
  3. In the update branch, after the Get Service Process Details action, add a Loop element for the child-node collection.
    Select ContextAttributes.ctx_caseNode.ctx_AccountNode as the collection variable. The resource names correspond to the Apex-defined variables for the context definition.
  4. If the context definition contains additional child-node levels, add a nested loop for each level.
  5. In each loop, add an Assignment element that stores the context attribute from the current loop item in the corresponding flow variable.
    Set Output_Ctx_AccountName to the AccountNode_Name value from the current AccountNode item.
  6. In the Screen element, set the default value for each context attribute component.
    1. For a top-level node attribute, select the corresponding output from the Get Service Process Details action.
      For example, use GetSvcProcessDetails.contextAttributes.ctx_caseNode.caseNode_Subject for the Subject component.
    2. For a child-node attribute, select the flow variable that you assigned in the loop.
      For example, use Output_Ctx_AccountName for the Account Name component.
  7. In the existing Action Detail element, turn on Context Attributes, and then select the root context definition variable.
    Generated intake forms include the Action Detail element by default. The flow uses the same element for create and update scenarios.
  8. Save and activate the flow.

When a requestor opens the intake form to update a service catalog request, the form shows the existing context attribute values. The Action Detail element includes the updated values with the request.

 
Laster
Salesforce Help | Article