top of page
OmniStudioFactBg.png
Search

Exposed Attributes in Flexcard

  • Writer: Gayathiri Mohan
    Gayathiri Mohan
  • Jul 13, 2023
  • 2 min read

Use “Exposed Attributes” to define an attribute that creates a public property for a Flexcard whose value can be set in the Lightning App Builder and Experience Builder.



Steps:

In your Flexcard, go to the Setup -> EXPOSED ATTRIBUTES section -> Click ‘Add New’ button -> the ‘Exposed API’ modal appears.

ree
ree

In the ‘Exposed API’ popup modal, enter the required details.

  • Attribute: Enter the name of the attribute in PascalCase (For example: RecordLimit).

  • Type: Select the required attribute type. The following types are available: Integer, String and Boolean.

  • Targets: Select the targets where you want the Flexcard attribute to be exposed.

  • Label: Enter the label text that will be displayed in the Lightning App Builder or the Experience Builder when you add the Flexcard.

  • Default Value: Enter an optional default value for the attribute.


To access the “Exposed Attribute” in your Flexcard, call it as a session variable in the format {Session.AttributeName} wherever merge fields are supported in Flexcard.


Let's see a sample use case of "exposed attributes”.


Limit the number of records displayed in a datatable:

In the below example, an attribute ‘RecordLimit’ of type ‘Integer’ is created with a label and a default value.

ree

A datatable is added to the Flexcard, and in the Data Source query, {Session.RecordLimit} is used as a parameter to dynamically configure the number of records displayed in the datatable from the Lightning App Builder or the Experience Builder.

ree

Also, the exposed attribute is accessed in a text element using "{Session.RecordLimit}".

ree

After activating the Flex Card and adding it to the Lightning App Builder, the exposed attributes are available as public properties that can be configured from the builder.


By default, it will show the “Default Value” entered for that attribute in the Flexcard, and you can modify it as required and click ‘Save’.


Default Value: 3 Modified Value: 5


ree
ree







Now you can observe in the UI that the datatable displays five records and the text element displays ‘5’, based on the value entered in the Lightning App Builder.

ree



References:



 
 
 

Recent Posts

See All

Comments


OmniStudioFactFooterBg.png
logo.png

OmniStudiofacts helps us to build a Vlocity/OmniStudio Tech Community which focuses on sharing technical skills and experience across the globe.

© 2023 by OmniStudioFacts.

bottom of page