Valorx 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

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
recordsarray contains the selected or generated recordsEach record uses Salesforce API field names
The
objectIdspecifies the Salesforce object typeThis 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

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
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:
priceBookEntryRecordsJsonData Type: Text
Available for Output: Enabled

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:
pricebookIdData Type: Text
Available for Input: Enabled

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:
oppIdData 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.
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

Configure The Valorx Grid
Configure the Valorx Grid grid using the Grid ID:
PricebookEntry::34937bb2-c710-4ce2-b6c0-0f171085e6a0This 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]
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.

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.
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:
pricebookEntryRecordsData Type: Record
Object: PricebookEntry
Allow Multiple Values: Checked

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:
Object for "records" (Output)
Price Book Entry
jsonString
priceBookEntryRecordsJson
Additional Settings
Enable Manually assign variables.
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.
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:
tempOpportunityProductRecordData Type: Record
Object: Opportunity Product (
OpportunityLineItem)

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:
newOpportunityProductsRecordsData 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
Add a Loop element.
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:
{!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:
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.
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:
createdOpportunityProductJsonData 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.

Add Apex Action: Records to JSON
Add the Apex Action Records to JSON (valorxwave__VxRecordsToJson) to convert the created records into JSON format.
Configuration
Object
Opportunity Product
Records
newOpportunityProductsRecords
Additional Settings
Enable Manually assign variables.
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
Add a new Screen element.
From the Components panel, drag the Valorx Grid component onto the screen.
Configure the grid with the following:
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:
Click Save to save the Flow.
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:
The user launches the Flow from an Opportunity grid row action
Products are displayed from the selected Price Book
The user selects multiple products in the grid
Selected records are emitted as JSON
JSON is converted into a record collection
Opportunity Products are created in bulk
The created records are converted back to JSON
A final grid displays the newly created Opportunity Products
Last updated
Was this helpful?