Flexcards Context Variables (Managed Package)

For the managed package runtime, global and local context variables are available to a Flexcard to provide context to data sources, actions, and other components. All variables are case sensitive.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

Global Variables

Name

Description

Merge Field

Label

Salesforce Custom Labels. See Add Custom Labels to Supported Fields on a Flexcard (Managed Package).

{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 (Managed Package).

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: Display as a Label when Collapsible is enabled

  • Field element: Display as the Output

  • Text element: Display 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 Inside Another Flexcard (Managed Package).

{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 (Managed Package).

{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 Add Session Variables to a Flexcard (Managed Package).

{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 at run time only. 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}.

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.