You are here:
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.
- In Flow Builder, open the intake form flow that supports updates.
-
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_Nametext attribute, create a Text variable namedOutput_Ctx_AccountName. -
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_AccountNodeas the collection variable. The resource names correspond to the Apex-defined variables for the context definition. - If the context definition contains additional child-node levels, add a nested loop for each level.
-
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_AccountNameto theAccountNode_Namevalue from the current AccountNode item. -
In the Screen element, set the default value for each context attribute component.
-
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_Subjectfor the Subject component. -
For a child-node attribute, select the flow variable that you assigned in the loop.
For example, use
Output_Ctx_AccountNamefor the Account Name component.
-
For a top-level node attribute, select the corresponding output from the Get
Service Process Details action.
-
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.
- 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.
