Vlocity Facts #22| Pass dynamic value to Look-up element from Typeahead block element

Scenario: We need to update contact details based on Account. If user select one account record from Typeahead block, related contact records should be displayed in another drop-down.

For this scenario we can Typeahead block and lookup element. 

  • Typeahead block -- User can select the record by typing the name. 
  • Lookup -- The associated records related to the selected record will be displayed in Lookup.
Creation of Typeahead block 
While configuring Typeahead block in Typeahead Key mention the Json node based on your requirement [Name, Phone, Email ...,] which need to be displayed as a drop down for user to select.
I have given Name in Typeahead Key to display Account names.
Image  Image

Creating DataRaptor Extract 
We are passing SelectAccount as data source [Typeahead block element name]. After creating DR drag on drop into the typeahead block.
Image Image

Configuring Look-up Element
After selecting one name from the typeahead block the Id of the selected account we are passing to the look-up element as a Data Source.

Syntax : TypeAhead Block element name:Blockname:JsonNode
                                      Data Source: ChooseAccount:SelectAccount-Block:ACCId
                                      Filter Name: AId
Image  Image
Image

Populate Lookup Element with Query Results:
  • JSON Path Use As The Value In Lookup -- It will help to pass the value to the JSON sfter selecting the value from drop down in lookup.
  • JSON Path Use As The Label In Lookup -- It will help to display the value from drop down in lookup. 
Conditional View for Lookup Element
Lookup element should be displayed only when account is selected from typeahead block.
Image

Output
Image  Image
Image


Comments

Popular posts from this blog

Vlocity Facts #01 | OmniStudio DataRaptors

Vlocity Facts #34 || Getting the details from the URL in a FlexCard and an Omniscript

Vlocity Facts #44 || Communication between Omniscript and Flexcard [Pub/Sub]