---
schema_version: "1"
id: 821593d85616ea5b9574db0e8983267132b855fd338f2da0d32e8f01d7729260
title: Create a Flow for Prior Authorization Check
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/bre_hc_create_flows.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.bre_hc_create_flows.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 17aae5b2f2a48a61f9bc6f639fdd9e99d19f9fde425009f6999f5fb6d62372a0
description: A Salesforce Flow brings the Context Service and Business Rules Engine components on a single platform and helps you run the scenario to experience how these components work together to give the expected results. Create a flow to test the Health Cloud scenario and verify if you're getting the expected results. In this flow, you first add a screen component to capture the user inputs. Then, use the Get Records elements to fetch the Context IDs that you use to hydrate context data. Add a loop element to find the prior authorization and benefit details for each service code. Use a Build Context action element inside the loop to hydrate data from the Member Plan object and its child nodes. Then, add an action element to call the expression set that uses the hydrated data to get the prior authorization check status for each service code and the corresponding coverage benefit details and approval status.
products:
  - Industry Solutions
  - Cross Cloud
release: "264"
---
# Create a Flow for Prior Authorization Check

A Salesforce Flow brings the Context Service and Business Rules Engine components on a single platform and helps you run the scenario to experience how these components work together to give the expected results. Create a flow to test the Health Cloud scenario and verify if you're getting the expected results. In this flow, you first add a screen component to capture the user inputs. Then, use the Get Records elements to fetch the Context IDs that you use to hydrate context data. Add a loop element to find the prior authorization and benefit details for each service code. Use a Build Context action element inside the loop to hydrate data from the Member Plan object and its child nodes. Then, add an action element to call the expression set that uses the hydrated data to get the prior authorization check status for each service code and the corresponding coverage benefit details and approval status.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions for clouds that have Business Rules Engine enabled</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d9092e67">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d9092e67 ">To create a flow:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d9092e67 ">Manage Flow</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d9092e67 ">To invoke an expression set:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d9092e67 ">Rules Engine Runtime</td>

          </tr>
        </tbody>
      </table>

1. From Setup, in the Quick Find box, enter Flows, and then select **Flows**.
2. Click **New Flow**.
3. Select **Start From Scratch**, and then click **Next**.
4. Select **Screen Flow**, and then click **Create**.

## Create a User Input Screen

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png).
    
    ![A new Flow page.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow1.png)
2. Select the **Screen** interaction element.
    
    ![The various options under Add Elements.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow2.png)
3. In the Screen Properties section, enter Enter Details as the label.
4. Drag the Text component from the Components list to the Header component.
    
    ![The Edit Screen to customize the screen properties.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow3.png)
5. Add the Text details.
    - Label: Member Number
    - API Name: MemberNumberInput
6. Select **Require**.
    
    ![The Edit Screen to customize the screen properties.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow4.png)
7. Drag the Date component from the Components list to the Member Number text component.
8. Under Date, enter Date of Service as the label.
9. Select **Require**.
10. Drag the Text component to the Date of Service date component.
11. Under Text, enter Member Plan Type as the label.
12. Similarly, add these service code details in sequence.
    
    | Component | Label |
    | --- | --- |
    | Text | Service Code 1 |
    | Text | Service Code 2 |
    | Text | Service Code 3 |
    | Text | Service Code 4 |
    
    ![The completed New Screen page with the corresponding screen properties.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow5.png)
13. Click **Done**.
14. Save your changes.
15. Enter Health Care Prior Authorization Check as the flow label.
16. Save your changes.

## Assign Variables to Service Codes

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Enter Details element.
2. Select the **Assignment** element.
3. In Label and API Name, enter ServiceCodeList.
4. Enter the variable values.
    1. Click in the Variable field.
    2. Select **New Resource** from the dropdown.
        
        ![Search variables](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow6.png)
    3. Select **Variable** as the resource type.
    4. Enter c\_ServiceCode as the API name.
    5. Select **Text** as the data type.
    6. Select **Allow multiple values (collection)**.
    7. Click **Done**.
    8. Select **Add** as the operator.
    9. Click in the Value field, and select the **Service Code 1** screen component.
    10. Click **Add Assignment**.
    11. Similarly, add these variable values.
        
        | Variable | Operator | Value |
        | --- | --- | --- |
        | c\_ServiceCode | Add | Service Code 2 |
        | c\_ServiceCode | Add | Service Code 3 |
        | c\_ServiceCode | Add | Service Code 4 |

## Add Context IDs

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the ServiceCodeList element.
2. Select the **Get Records** element.
3. Enter Get Context Definition Id as the label.
4. Select **Context Definition** as the object.
5. Under Filter Context Definition Records, add these details.
    1. Select **All Conditions Are Met (AND)** as the condition requirement.
    2. Select **DeveloperName** as the field.
    3. Select **Equals** as the operator.
    4. Enter Get\_MemberPlan\_Details as the value.
6. Save your changes.
7. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Get Context Definition Id element.
8. Select the **Get Records** element.
9. Enter Get Context Version Id as the label.
10. Select **Context Definition Version** as the object.
11. Under Filter Context Definition Version Records, add these details.
    1. Select **All Conditions Are Met (AND)** as the condition requirement.
    2. Select **ContextDefinitionId** as the field.
    3. Select **Equals** as the operator.
    4. Enter Context Definition from Get\_Context\_Definition\_Id > Context Definition Id as the value.
12. Save your changes.
13. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Get Context Version Id element.
14. Select the **Get Records** element.
15. Enter Get Mapping Id as the label.
16. Select **Context Mapping** as the object.
17. Under Filter Context Mapping Records, add these details.
    1. Select **All Conditions Are Met (AND)** as the condition requirement.
    2. Select **ContextDefinitionVersionId** as the field.
    3. Select **Equals** as the operator.
    4. Enter Context Definition Version from Get\_Context\_Version\_Id > Id (Context Definition Version Id) as the value.
18. Save your changes.

## Add Loop

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Get Mapping Id element.
2. Select the **Loop** element.
3. Enter Loop through Service Codes as the label.
4. Select **c\_ServiceCode** as the collection variable.
5. Select **First item to last item** as the direction.

## Hydrate Member Plan Object and Child Nodes Data

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after For Each.
2. Select the **Action** element.
3. Find and select the **Build Context** action.
4. Enter Hydrate data from Member Plan Object and its child nodes as the label.
5. Under Set Input Values for the Selected Action, add these details.
    1. Select **Context Definition from Get\_Context\_Definition\_Id > Context Definition Id** as the context definition.
    2. Turn on Context Data and enter {"MemberPlan":\[{"id":"<record id>","businessObjectType":"MemberPlan"}\]}. To get the record ID, open the [Cigna Medicare Advantage Plan member](https://help.salesforce.com/s/articleView?id=ind.bre_hc_create_plans.htm&release=264.0.0&type=5 "Create Member Plans, Purchaser Plans, Coverage Benefits, and Coverage Benefit Items to ensure that the Health Cloud prior authorization workflow accurately reflects the rules and coverage details required to assess user eligibility and calculate benefits. These objects are the data sources for context definition and Business Rules Engine.") plan record that you created earlier and copy the record ID from the URL. Paste the record ID in the <record id> placeholder. For example, 0SqdN0000000ExRSAU is the record ID shown in the screenshot.
        
        ![Record ID value is to be copy pasted from the URL.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_sg_hc_flow7.png)
    3. Turn on Context Mapping and select **Context Mapping from Get Mapping Id > Context Mapping Id** as the context mapping.
6. In the Show advanced options section, select **Let the flow decide (Recommended)** as the transaction control.
7. Save your changes.

## Assign Service Code

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Hydrate data from Member Plan Object and its child nodes element.
2. Select the **Assignment** element.
3. In Label and API Name, enter Assign Service Code.
4. Under Set Variable Values, add these details.
    1. Click in the Variable field.
    2. Select **New Resource** from the dropdown.
    3. Select **Variable** as the resource type.
    4. Enter ServCode as the API name.
    5. Select **Text** as the data type.
    6. Click **Done**.
    7. Select **Equals** as the operator.
    8. Click in the Value field, and select **Current Item from Loop Loop\_through\_Service\_Codes**.
5. Save your changes.

## Fetch Expression Set Details

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Assign Service Code element.
2. Select the **Action** element.
3. Find and select the **Member Plan Status Check-Bre** action.
4. Enter Member Plan Details as the label.
5. Under Set Input Values for the Selected Action, add these details.
    1. Turn on DateOfService and select **Enter Details > Date of Service** as the date of service.
    2. Turn on MemberNumberInput and select **Enter Details > Member Number**.
    3. Turn on Get\_MemberPlan\_DetailsId select **Outputs from Hydrate data from Member Plan Object and its child nodes > Context Id**.
    4. Turn on ServiceCode and select **ServCode**.
6. Save your changes.

## Assign Output Values

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Member Plan Details element.
2. Select the **Assignment** element.
3. Enter Output Values from Expression Set as the label.
4. Enter OutputValues as the API name.
5. Under Set Variable Values, add these details.
    1. Click in the Variable field.
    2. Select **New Resource** from the dropdown.
    3. Select **Variable** as the resource type.
    4. Enter c\_PriorAuthDetermination as the API name.
    5. Select **Text** as the data type.
    6. Select **Allow multiple values (collection)**.
    7. Click **Done**.
    8. Select **Add** as the operator.
    9. Click in the Value field, and select **Outputs from Member\_Plan\_Details > PriorAuthDetermination**.
6. Save your changes.

## Show Results

1. Click ![Add Elements](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/business_rules_engine/images/bre_add_elements.png) after the Output Values from Expression Set element.
2. Select the **Screen** element.
3. Enter Result Screen as the label.
4. Drag a Display Text component to the Header component.
5. Enter Results as the API name.
6. In the text input field, enter Prior Authorization Determination - and click in the Insert a resource field.
7. Find and select **Outputs from Member\_Plan\_Details > PriorAuthDetermination**.
8. Click **Done**.
9. Save your changes.
10. Click **Activate**.