top of page
OmniStudioFactBg.png
Writer's pictureGayathiri Mohan

Exposed Attributes in Flexcard

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.

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.

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.

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

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









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.




References:



379 views0 comments

Recent Posts

See All

Commenti


bottom of page