Flexcards Context Variables

To provide context to data sources, actions, and other components, add global and local context variables to a Flexcard. All variables are case-sensitive.

Global Variables

Name

Description

Merge Field

Label

Salesforce Custom Labels.

{Label.mylabel}

For example, {Label.AccountName} gets a custom label named AccountName.

objectApiName

Beginning Winter '22, pass the object API Name to a component as an attribute, such as a Custom LWC, when a Flexcard is on a record page. Similar to {recordId}, use Test Parameters to verify in Preview. See Test Data Source Settings on a Flexcard.

Supported property fields:

  • Flyout action: Pass as an Attribute to a child Flexcard, Custom LWC, and Omniscript

  • Custom LWC and child Flexcard elements: Pass as an Attribute

  • Block element: Show as a Label when Collapsible is enabled

  • Field element: Show as the Output

  • Text element: Show as plain text

{objectApiName}

For example, use an SOQL Query to get a list of accounts. Enter {objectApiName} as the object to query. Then add a Test Parameter whose Key is ObjectApiName and Value is Account.

Params

The page parameters passed to the URL.

{Params.fieldName}

For example, {Params.Id} gets the context Id. We recommend using {recordId} to get the context Id of a record.

Parent

Reference attributes from the parent Flexcard on the child Flexcard with this variable. Attributes are defined at design time on the parent Flexcard. See Embed Flexcard in a Flexcard.

{Parent.attributeName}

For example, Parent.Id gets the {Id} attribute defined on the parent Flexcard.

recordId

Gets the context Id of a Salesforce object's data record. Use Test Parameters to verify in Preview. See Test Data Source Settings on a Flexcard.

{recordId}

For example, if using an Omnistudio Data Mapper to get a list of Account Cases, in the Input Map, enter AccountId as Key and {recordId} as the Value. Then add a Test Parameter whose Key is recordId and Value is 138238279r9ff to populate your Flexcard with actual data.

records

The records object of the Flexcard, which can be passed on to Child Flexcard, Custom LWC, and Flyout parameters.

{records}

For example, {records} gets all records, while {records [0]} gets the first available record.

Session

Variables used to store values from data sources and external systems, and hardcoded values. Properties are defined at design time on the Flexcard. See Configure Flexcard Settings.

{Session.sessionkey}

For example, {Session.pageLimit} gets a session variable named pageLimit.

User

User and Contact properties for the logged-in user.

Note
Note

Rendered User context variable is viewable only at run time. View in Preview.

Available properties:

  • userId: User's Salesforce Id.

  • userAnLocale: User's personal locale.

  • userSfLocale: Salesforce org's locale.

  • userCurrency: User's default currency.

  • userLanguage: User's default language.

  • userTimeZone: User's timezone.

  • userName: User's username.

  • userType: User's license type.

  • userRole: User's role.

  • userProfileName: Profile name from the Profile lookup.

  • userProfileId: Salesforce Id from the Profile lookup.

  • userAccountId: Salesforce id from the Account lookup.

  • userContactId: Salesforce id from the Contact lookup.

{User.property}

For example, {User.userName} gets the logged in user's username.

Local Variables

Name

Description

Merge Field

action

The parameters received by an event listener and sent to an action.

{action.parameter}

For example, if your event is sending you a contextId parameter, then use {action.contextId}.

To send parameters to an action from a data table, use the {action.result.X} format, where X represents any field name defined within the data source.

element

The values set by the toggle element and tied to an action.

  • Checkbox Toggle type: element.checked

  • All other Toggle types: element.value

{element.value}, {element.checked}

record

The record object that belongs to the State, and passed on to Child Flexcard, Custom LWC, and Flyout parameters.

{record}, {record.FieldName}

For example, {record} gets the entire record, while {record.Name} gets the Name field from the record.