Final Up to date on October 9, 2022 by Rakesh Gupta
Huge Thought or Enduring Query:
- Find out how to show information in a desk utilizing the datatable and course of chosen information?
Aims:
After studying this weblog, you’ll be capable of:
- Perceive how you can use information desk
- Works with Get Data component to fetch information
- Add columns to datatable
- Replace a number of information utilizing In operator
- And rather more
Rachel Gillett is working as a Junior Developer at Gurukul on Cloud (GoC). She has obtained the next requirement from the administration:
- Add a button on the account object that opens up a display screen that enables gross sales reps to pick out a number of associated open alternatives.
- Present an possibility to pick out Stage for the chosen alternatives.
- In the long run, replace the stage for chosen alternatives.
Automation Champion Method (I-do):
Salesforce Display Move DataTable is a robust and good desk element offered by Salesforce Move. It’s a extremely versatile element that shows info in tables and provides interactions to them.
There are a couple of attainable options for the above enterprise state of affairs. We are going to use Display Move and Knowledge Desk (Beta) to resolve the requirement.
Earlier than we proceed additional, allow us to perceive the traits of the DataTable element.
Attribute | Particulars |
Supply Assortment | Assortment of information to make use of to populate the desk. |
Row Choice Mode | Signifies what number of rows the person can choose within the desk. You possibly can set the worth to:
|
Minimal Row Choice | Specifies the minimal variety of rows that the person should choose. |
Most Row Choice | Specifies the utmost variety of rows that the person can choose. |
Default Choice | The gathering specifies which information to preselect within the desk. |
Require person to make a choice | Specifies the utmost variety of rows that the person can choose. Specifies whether or not the person should choose a row earlier than navigating to the subsequent display screen. |
Earlier than discussing the answer, let me present you a diagram of a Course of Move at a excessive degree. Please spend a couple of minutes going via the next Move diagram and understanding it.
Let’s start constructing this automation course of.
Guided Observe (We-do):
There are 9 steps to resolve Rachel’s enterprise requirement utilizing Display Move. We should:
- Outline move properties for display screen move
- Add a textual content variable to retailer the account Id
- Add a textual content assortment variable to retailer the chosen alternative Ids
- Add a Get Data component to search out the open alternatives
- Add a Display component to show the information in a desk format and a Stage drop-down
- Add a loop component to extract chosen alternatives from the report assortment variable (step 5)
- Add an task component so as to add alternative Id to the gathering variable (Created in step 1.3)
- Add an Replace Data component to replace the chance stage of chosen information
- Create a Fast Motion to Launch the Move.
Step 1: Outline Move Properties
- Click on Setup.
- Within the Fast Discover field, sort Flows.
- Choose Flows, then click on on the New Move.
- Choose the Display Move possibility and click on on Create and configure the move.
- It would open the move designer for you.
Step 2: Add a Textual content Variable to Retailer Account Id
- Beneath Toolbox, choose Supervisor, then click on New Useful resource to retailer the account Id.
- Enter the next info:
- Useful resourceKind: Variable
- API Identify: recordId
- Knowledge Kind: Textual content
- Default Worth: {!$GlobalConstant.EmptyString}
- Test Out there for Enter
- Test Out there for Output
- Click on Achieved.
Step 3: Add a Assortment Variable Textual content to Retailer Chosen Alternative Ids
- Beneath Toolbox, choose Supervisor, then click on New Useful resource to retailer the chosen Alternative Ids.
- Enter the next info:
- Useful resourceKind: Variable
- API Identify: varT_OpportunityIds
- Knowledge Kind: Textual content
- Default Worth: {!$GlobalConstant.EmptyString}
- Test Enable a number of values (assortment)
- Test Out there for Enter
- Test Out there for Output
- Click on Achieved.
Step 4: Including a Get File Component to Discover the Open Alternatives
The following step is utilizing the Alternative object to search out the open alternatives on the present account.
- On Move Designer, click on on the +icon and choose the Get Data component.
- Enter a reputation within the Label subject; the API Identify will auto-populate.
- Choose the Alternative object from the dropdown checklist.
- Choose All Situations Are Met (AND).
- Set Filter Situations
- Row 1:
- Area: AccountId
- Operator: Equals
- Worth: {!recordId}
- Click on Add Situation
- Row 2:
- Area: IsClosed
- Operator: Equals
- Worth: {!$GlobalConstant.False}
- Row 1:
- How Many Data to Retailer:
- Choose All report
- Find out how to Retailer File Knowledge:
- Select the choice to Mechanically retailer all fields.
- Click on Achieved.
Step 5: Add a Display Component to Show the Open Alternatives in a Desk Format and a Stage Drop-down
- Beneath Get Alternatives Node, click on on the +icon and choose the Display component on Move Designer.
- Enter the next info:
- Enter Label the API Identify will auto-populate.
- Try the video for step-by-step directions and a few suggestions.
Step 6: Add a Loop Component to Extract Chosen Alternative Data from File Assortment Variable (Step 5)
- On Move Designer, click on on the +icon and choose the Loop component.
- Enter a reputation within the Label subject; the API Identify will auto-populate.
- For Assortment Variable choose {!Open_Opps.selectedRows}.
- For Specify Path for Iterating Over Assortment, choose the choice First merchandise to final merchandise.
- Click on Achieved.
Step 7: Including an Task Component to Add Alternative Id to the Assortment Variable Textual content (Created in step 1.3)
- On Move Designer, click on on the +icon and choose the Task component.
- Enter a reputation within the Label the API Identify will auto-populate.
- Set Variable Values
- Row 1:
- Area: {!varT_OpportunityIds}
- Operator: Add
- Worth: {!Loop_through_Selected_Record.Id}
- Row 1:
- Click on Achieved.
Step 8: Including an Replace Data Component to Replace the Alternative Stage of Chosen Data
The following step is to replace the chance stage of chosen information. We are going to use the Replace Data component.
- On Move Designer, click on on the +icon and choose the Replace Data component.
- Enter a reputation within the Label subject; the API Identify will auto-populate.
- For Find out how to Discover Data to Replace and Set Their Values choose Specify circumstances to establish information, and set fields individually
- Object: Account
- Choose All Situations Are Met (AND).
- Set Filter Situations
- Row 1:
- Area: Id
- Operator: In
- Worth: {!varT_OpportunityIds}
- Row 1:
- Set Area Values for the Alternative Data
- Row 1:
- Area: StageName
- Worth: {!Stage}
- Row 1:
- Click on Achieved.
In the long run, Rachel’s Move will seem like the next screenshot:
As soon as every part appears good, carry out the steps under:
- Click on Save.
- Enter the Move Label the API Identify will auto-populate.
- Click on Present Superior.
- API Model for Working the Move: 56
- Interview Label: DataTable Move Instance {!$Move.CurrentDateTime}
- Click on Save.
Nearly there! As soon as every part appears good, click on the Activate button.
Step 9: Create a Fast Motion to Launch the Move
The following step is to create a Fast Motion on the Account object to launch the Display Move. Salesforce will robotically move the Account Id to the recordId variable.
- Click on Setup.
- Within the Object Supervisor, sort Account.
- Choose Buttons, Hyperlinks, and Motion, then click on New Motion.
- Enter the next info:
- Choose Move as Motion Kind.
- Choose DataTable Move Instance as Move.
- Enter Label (Replace Alternative) the Identify will auto-populate.
- Click on Save.
Make sure that so as to add the Fast motion to the Account Lightning File Pages.
👉 Try the video for step-by-step directions.
Proof of Idea
From now onwards, at any time when a person clicks on the Replace Alternative button, Move will populate a display screen with open alternatives.
Formative Evaluation:
I need to hear from you!
What’s one factor you discovered from this publish? How do you envision making use of this new data in the actual world? Be at liberty to share within the feedback under.