For the complete documentation index, see llms.txt. This page is also available as Markdown.

Grid in Flow

Overview

Connect the Valorx Grid to your Salesforce Flow so users can review, select, and create multiple records all within a single workflow.

Grid integration supports two main operations:

Grid Input

Pass records into the grid from Flow. The grid displays them for users to review. Useful for confirming or previewing records.

Grid Output

Let users select rows and emit them back to Flow as JSON. Flow then processes the selected records in later steps.

Valorx Grid in Flow

End-to-end example: Opportunity Product Selection

This walkthrough shows how to build a Flow that lets users pick products from a Price Book grid and automatically create Opportunity Products with a preview at the end.

GRID 1 Opportunity Grid Launches the Flow via row action

Trigger

GRID 2 Price Book Entries User selects

Output grid

GRID 3 Opportunity Products Preview of created

Input grid

Grid 1 – Opportunity Grid

  • 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 Flow variables

Before building any screens or logic, set up the three variables you'll need throughout the Flow.

1

Variable 1 — Store selected records as JSON

The grid emits selected records as a JSON string. This variable captures that output so it can be passed to an Apex action later.

Setting
Value

API Name

priceBookEntryRecordsJson

Data Type

Text

Available for Output

Enabled

2

Price Book ID (for dynamic filtering)

Holds the Price Book ID passed in by the row action. Used to filter the grid so users only see products from the correct Price Book.

Setting
Value

API Name

pricebookId

Data Type

Text

Available for Input

Enabled

3

Variable 3 — Opportunity ID

Needed to link each new Opportunity Product to its parent Opportunity when the records are created.

Setting
Value

API Name

oppId

Data Type

Text

Available for Input

Enabled


Step 2 – Configure the Product Selection Screen

Add a Screen element with a Valorx Grid so users can browse and select Price Book products.

1

Screen Configuration

Add a Screen element to the Flow.

Setting
Value

Label

Grid Output

API Name

Grid_Output

Drag the Valorx Grid component from the Components panel onto the screen. Set its API Name to PriceBookGrid.

2

Set the Grid ID — this connects the component to your published Valorx Grid: PricebookEntry::34937bb2-c710-4ce2-b6c0-0f171085e6a0

Find your Grid ID from the Wave Dashboard: open a Card → More Options → Publish.

3

Configure Dynamic Filtering

To show only products from the selected Price Book, add this to the Input Variables of the grid component:

  • 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 the grid automatically filters records based on the Price Book ID passed in by the row action.

4

Store Selected Records

When the user clicks Next, the grid emits selected records as JSON. Store that output:

Configuration

  • Expand the Advanced section.

  • Enable Manually assign variables.

  • Under Output Records, select priceBookEntryRecordsJson .


Step 3 – Convert JSON to to Salesforce Records

Flow can't work with raw JSON directly. So, we need to use the built-in Apex action to convert it into SObject records.

1

Create A Record Collection Variable

This collection will hold the converted PricebookEntry records so the Flow can loop over them.

Setting
Value

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. Search for and add: Convert JSON to Records valorxwave__VxJsonToCollection that enables Flows to convert JSON data into Salesforce record collections.

Set the following fields:

Field
Value

Object for "records" (Output)

Price Book Entry

jsonString

priceBookEntryRecordsJson

Then enable Manually assign variables and store Output Records in pricebookEntryRecords.

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


Step 4 – Prepare Opportunity Product Variables

Create two variables: one for building each record inside the loop, and one collection to hold all the records before bulk insert.

1

Temporary record variable (built one at a time inside the loop)

Setting
Value

API Name

tempOpportunityProductRecord

Data Type

Record

Object

Opportunity Product (OpportunityLineItem)

2

Record collection variable (accumulates all records for bulk insert)

Setting
Value

API Name

newOpportunityProductsRecords

Data Type

Record

Object

Opportunity Product

Allow Multiple Values

Checked


Step 5 – Add Loop Element

Process each selected Price Book Entry one at a time to create a matching Opportunity Product.

Add a Loop element to the Flow and configure it:

Setting
Value

Collection Variable

pricebookEntryRecords

Steps 6 and 7 both happen inside this loop. The loop runs once per selected product row.


Step 6 – Assign Field Values (Inside The Loop)

Map fields from the selected Price Book Entry to the temporary Opportunity Product record.

Add an Assignment element inside the loop:

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 The Record to The Collection (Inside The Loop)

After building each Opportunity Product, add it to the collection so all records can be created together.

Add a second Assignment element inside the loop:

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 (Bulk Insert)

Insert all selected products in a single operation after the loop finishes — this is more efficient and avoids governor limits.

Add a Create Records element after the loop (not inside it):

Setting
Value

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 Back to JSON

To show a preview grid, the records must be converted back to JSON format and that's what the Grid Input component expects.

1

Create JSON Text Variable

Setting
Value

API Name

createdOpportunityProductJson

Data Type

Text

2

Add Apex Action: Records to JSON

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

Field
Value

Object

Opportunity Product

Records

newOpportunityProductsRecords

Enable Manually assign variables and store the output in createdOpportunityProductJson.


Step 10 – Add Preview Screen

Show users the Opportunity Products that were just created, displayed in a read-only grid.

Add a new Screen element and drag a Valorx Grid component onto it. Configure the grid:

Field
Value

Grid ID

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

Input Records

createdOpportunityProductJson


Step 11 - Save and Activate the Flow

Once all steps are configured, save and activate to make the Flow available.

  1. Click Save to save all changes.

  2. Click Activate to publish the Flow.

  3. The row action in your Opportunity Grid will now trigger this Flow.

You can test the Flow in debug mode from the Flow builder before activating.


What happens when the Flow runs

  1. User clicks a row action from the Opportunity Grid, launching the Flow with the Opportunity ID and Price Book ID.

  2. The Price Book Entries grid loads, filtered to show only products from the selected Price Book.

  3. User selects one or more products and clicks Next — the grid emits selected records as JSON.

  4. The Apex action converts the JSON into a Salesforce record collection.

  5. The Flow loops over the records, building an OpportunityLineItem for each selection.

  6. All Opportunity Products are inserted in a single bulk operation.

  7. The created records are converted back to JSON and passed to the preview grid.

  8. The user sees a confirmation screen listing all newly created Opportunity Products.


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)

  • VxCollectionToJson (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

Last updated

Was this helpful?