arrow-progressValorx Grid in Flow

Overview

Valorx Grids can integrate with Salesforce Flow to exchange records during Flow execution. Records can be passed into a grid for display and editing, and selected records can be returned to the Flow for further processing.

This enables interactive workflows where users can review, select, and modify multiple records in a spreadsheet-style grid while leveraging Flow automation.

Grid integration supports two main operations:

  • Grid Input – passing records into the grid

  • Grid Output – emitting selected records from the grid

Valorx Grid in Flow

Grid Input

Grid Input allows a Flow or wrapper component to initialize a grid with records.

When records are passed to the grid:

  • The grid loads the records at runtime

  • Users can review or interact with the records

  • The grid displays them using the configured grid layout

Example Use Cases

  • Display records retrieved by a Flow

  • Show newly created records for confirmation

  • Pass records from one grid to another grid within the same Flow

Configuration

Records are passed to the grid through the Input Records property in the grid component.

The grid expects records in JSON format.


Grid Output

Grid Output allows the grid to emit records back to the Flow.

The grid emits selected records as a JSON array of Salesforce-style objects (using API field names).

When users select records in the grid:

  • The selected records are emitted as JSON

  • The JSON output is stored in a Flow variable

  • The Flow can process the records in later steps

Only selected records are included in the output.

Example Use Cases

  • Selecting records for processing

  • Passing records to another grid

  • Creating new records based on user selections


JSON Structure Reference (Advanced)

The Valorx Grid uses a structured JSON format when exchanging records with Salesforce Flow. This format is used internally by Apex actions such as:

  • VxJsonToCollection (JSON → Records)

  • VxRecordsToJson (Records → JSON)

The JSON consists of:

  • A records array containing the data

  • An objectId that identifies the Salesforce object

JSON Schema

Example

Notes

  • The records array contains the selected or generated records

  • Each record uses Salesforce API field names

  • The objectId specifies the Salesforce object type

  • This structure is required for Apex actions to correctly process the data


Example Scenario

Opportunity Product Selection & Line Item Creation

This example demonstrates how Valorx Grid integrates with Salesforce Flow to support a complete product selection and record creation workflow.

The Flow allows users to:

  • Launch a Flow from an Opportunity

  • View products from the Opportunity’s Price Book

  • Select multiple products in a grid

  • Automatically create Opportunity Products

  • Preview the created records within the Flow

This approach simplifies adding multiple products to an Opportunity without leaving the current workflow.


Solution Architecture

This solution uses three grids working together in a Flow.

Grid 1 – Opportunity Grid

  • Contains a Row Action that launches the Flow.

  • Contains a Row Action that launches the Flow.

    The row action passes:

    • Opportunity ID

    • Price Book ID

Opportunity Grid

Grid 2 – Price Book Entries Grid (Output Grid)

  • Object: Price Book Entries

  • This grid uses a dynamic filter to ensure that only products associated with the selected Price Book are displayed.

Purpose:

  • Displays products from the selected Price Book

  • Allows users to select multiple products

  • Emits selected records in JSON format

Grid 3 – Opportunity Product Grid (Input Grid)

  • Object: Opportunity Product (OpportunityLineItem)

Purpose:

  • Displays the Opportunity Products created by the Flow

  • Accepts records passed from the Flow as JSON


Step-by-Step Configuration

Step 1 - Create Required Variables

1

Variable to Store Selected Records

Purpose: The Valorx Grid emits the selected records as a JSON string. This variable stores that JSON output so it can be passed to an Apex action that converts it into PricebookEntry records (SObjects) for further processing in the Flow.

Configuration

Create a new Variable with the following settings:

  • API Name: priceBookEntryRecordsJson

  • Data Type: Text

  • Available for Output: Enabled

2

Variable for Price Book ID (Dynamic Filter)

Purpose: This variable stores the Price Book ID passed from the row action. It is used in the dynamic filter of the PricebookEntry grid to display only products that belong to the selected Price Book, ensuring users see only relevant products.

Configuration

Create another Variable with the following settings:

  • API Name: pricebookId

  • Data Type: Text

  • Available for Input: Enabled

3

Variable for Opportunity ID

Purpose: The Opportunity ID is required when creating OpportunityLineItem (Opportunity Product) records so each new line item is correctly associated with its parent Opportunity. This variable captures the Opportunity ID passed from the row action.

Configuration

Create another Variable with the following settings:

  • API Name: oppId

  • Data Type: Text

  • Available for Input: Enabled


Step 2 – Configure the Product Selection Screen

Add a Screen element to the Flow and configure the Valorx Grid component to allow users to select products.

1

Screen Configuration

Purpose: This grid serves as the user interface for selecting products. By linking the grid to the PricebookEntry object, it automatically displays standard fields such as Product Name and Unit Price, allowing users to select one or more products to add to the Opportunity.

Add a Screen element to the Flow.

  • Configure the screen:

    • Label: Grid Output

    • API Name: Grid_Output

  • From the Components panel, drag the Valorx Grid component onto the screen.

  • Configure the Valorx Grid component:

    • API Name: PriceBookGrid

2

Configure The Valorx Grid

  • Configure the Valorx Grid grid using the Grid ID: PricebookEntry::34937bb2-c710-4ce2-b6c0-0f171085e6a0

  • This links the grid to the Price Book Entry object so users can select products.

Note: To learn how to obtain the Grid Identifier from the Wave Dashboard (Card → More Options→Publish), see [Get Grid ID from Wave Dashboard]

3

Configure Dynamic Filtering

  • Copy the configured Dynamic Filter value from the grid and paste it into the Flow input variable.

  • Example: In Input Variables, add the filter: Pricebook2.Name = {!pricebookId}

  • This ensures that the grid only displays products belonging to the selected Price Book.

  • For more information about the Dynamic Filter format and how it works, see the Dynamic Filtering documentation.

4

Store Selected Records

Purpose: When the user clicks Next or another navigation button, the grid emits the selected records as a JSON string. This configuration captures that output and stores it in the priceBookEntryRecordsJson variable, allowing the selected records to be processed in later steps of the Flow.

Configuration

  • Expand the Advanced section.

  • Enable Manually assign variables.

  • Under Output Records, select priceBookEntryRecordsJson.


Step 3 – Convert JSON to Record

Before creating OpportunityLineItem records, the JSON output from the grid must be converted into Salesforce records (SObjects) that the Flow can process.

1

Create Record Collection Variable

Purpose: Flow cannot iterate over a JSON string. It requires a collection of SObject records to process data in a loop. This variable stores the converted PricebookEntry records so they can be iterated and used to create Opportunity products.

Configuration

Create a variable with the following settings:

  • API Name: pricebookEntryRecords

  • Data Type: Record

  • Object: PricebookEntry

  • Allow Multiple Values: Checked

2

Add Apex Action – Convert JSON to Records

Valorx provides a built-in Apex Action Convert JSON to Records (valorxwave__VxJsonToCollection) that enables Flows to convert JSON data into Salesforce record collections.

This action is commonly used when working with Grid Output, as the Valorx Grid emits selected records in JSON format. The action transforms this JSON into standard Salesforce records (SObjects), allowing the Flow to process them using native elements such as loops, assignments, and record creation.

Configuration

Add the Apex Action:

Convert JSON to Records (valorxwave__VxJsonToCollection)

Set the following fields:

Field
Value

Object for "records" (Output)

Price Book Entry

jsonString

priceBookEntryRecordsJson

Additional Settings

  1. Enable Manually assign variables.

  2. Under Output Records, store the records in the variable pricebookEntryRecords.

The JSON output returned by the grid is converted into a collection of PricebookEntry records, allowing the Flow to process the selected products in subsequent steps.

This action is required whenever Grid Output is used, as Flow cannot directly process JSON data.


Step 4 – Prepare Opportunity Product Variables

Before creating records in Salesforce, we first prepare variables that will hold the OpportunityLineItem (Opportunity Product) records during the Flow.

1

Create Temporary Record Variable

Purpose: Inside the loop, the Flow constructs one OpportunityLineItem record at a time. This temporary variable stores the current record being built before it is added to the final collection.

Configuration

Create a variable with the following settings:

  • API Name: tempOpportunityProductRecord

  • Data Type: Record

  • Object: Opportunity Product (OpportunityLineItem)

2

Create Record Collection Variable

Purpose: After each OpportunityLineItem record is prepared, it must be stored in a collection so all records can be created together in a single bulk operation. This collection accumulates all the records until the Create Records step.

Configuration

Create a variable with the following settings:

  • API Name: newOpportunityProductsRecords

  • Data Type: Record

  • Object: Opportunity Product

  • Allow Multiple Values: Checked


Step 5 – Add Loop Element

Purpose: Each selected PricebookEntry must be converted into an OpportunityLineItem. The loop processes the selected records one by one so the Flow can create a corresponding Opportunity product for each entry.

Configuration

  1. Add a Loop element.

  2. Set Collection Variable to pricebookEntryRecords.


Step 6 – Assign Field Values

Purpose: Map the selected PricebookEntry values to a temporary OpportunityLineItem record that will be created later in the Flow.

Configuration

Inside the Loop, add an Assignment element and map the fields as follows:

Variable
Operator
Value

{!tempOpportunityProductRecord.PricebookEntryId}

Equals

{!Opportunity_Product_Assignment.Id}

{!tempOpportunityProductRecord.UnitPrice}

Equals

{!Opportunity_Product_Assignment.UnitPrice}

{!tempOpportunityProductRecord.Quantity}

Equals

1

{!tempOpportunityProductRecord.OpportunityId}

Equals

{!oppId}

Explanation

  • PricebookEntryId links the Opportunity product to the selected product from the Price Book.

  • UnitPrice copies the product price from the Price Book Entry.

  • Quantity is set to 1 by default (users can adjust it later if needed).

  • OpportunityId associates the product with the current Opportunity.


Step 7 – Add Record to Collection

Purpose: Add the prepared OpportunityLineItem record to a collection so all records can be created together in a later step.

Configuration:

Inside the Loop, add another Assignment element and configure it as follows:

Variable
Operator
Value

newOpportunityProductsRecords

Add

tempOpportunityProductRecord

This step adds each generated record to the OpportunityLineItem collection, building the complete list of products that will be created for the Opportunity in a single bulk operation.


Step 8 – Create Opportunity Products

Purpose: Create the Opportunity products using a single bulk operation. Inserting records as a collection improves performance and helps avoid governor limits that could occur if records were created individually inside the loop.

Configuration

Add a Create Records element and configure it as follows:

  • How Many Records to Create: Multiple

  • Record Collection: newOpportunityProductsRecords

This step inserts all generated OpportunityLineItem (Opportunity Product) records at once, adding the selected products to the Opportunity.


Step 9 – Convert Created Records to JSON

To preview created records, convert them back to JSON.

1

Create JSON Variable

Purpose: To display the newly created records in the final preview screen, the records must be converted to JSON format, as the Valorx Grid Input expects JSON data.

Create a new variable with the following configuration:

  • API Name: createdOpportunityProductJson

  • Data Type: Text

This variable will store the JSON representation of the created OpportunityLineItem records, which will be passed to the grid for preview in the final screen.

2

Add Apex Action: Records to JSON

Add the Apex Action Records to JSON (valorxwave__VxRecordsToJson) to convert the created records into JSON format.

Configuration

Field
Value

Object

Opportunity Product

Records

newOpportunityProductsRecords

Additional Settings

  1. Enable Manually assign variables.

  2. Store the output JSON in createdOpportunityProductJson.

This action converts the collection of OpportunityLineItem (Opportunity Product) records into a JSON string, which can then be passed to the Input Grid for preview.


Step 10 – Add Preview Screen

Purpose: Display a summary of the records that were just created. Using an Input Grid in preview mode allows users to see the Opportunity products exactly as they will appear in Salesforce, providing immediate confirmation.

Configuration

  1. Add a new Screen element.

  2. From the Components panel, drag the Valorx Grid component onto the screen.

  3. Configure the grid with the following:

Field
Value

Grid ID

OpportunityLineItem::d18f616d-631b-4587-a55e-ddb0c206f8ea

Input Records

createdOpportunityProductJson

The grid uses the JSON data to display the newly created OpportunityLineItem (Opportunity Product) records in a structured preview format.


Step 11 - Save and Activate the Flow

After completing the configuration:

  1. Click Save to save the Flow.

  2. Click Activate to make the Flow available for use.

Once activated, the Flow can be launched and will allow users to select products using Valorx Grid, create Opportunity products, and preview the results.

Flow Execution Summary

When the Flow runs:

  1. The user launches the Flow from an Opportunity grid row action

  2. Products are displayed from the selected Price Book

  3. The user selects multiple products in the grid

  4. Selected records are emitted as JSON

  5. JSON is converted into a record collection

  6. Opportunity Products are created in bulk

  7. The created records are converted back to JSON

  8. A final grid displays the newly created Opportunity Products

Last updated

Was this helpful?