OmniStudio Display Data and Actions On A FlexCard
OmniStudio Display Data and Actions On A FlexCard
Exercise Guide
Requirements
“As a service agent, I'd like to view information about a customer account.”
Prerequisites
● Meet the Data Source Wizard
Tasks
1. Add and Style Block Elements
2. Add Text, Icon, and Menu Elements
3. Populate Elements in the FlexCard
Time
● 35 mins
3. From the search results, expand teamAccount. You created this FlexCard in the
previous exercise in Meet the Data Source Wizard.
Medium 5
f. Enter 350 in the Minimum Height field. Entering a number without a unit
defaults to the px unit.
g. Enter 375 in the Maximum Height field.
j. Scroll down to the ALIGNMENT section. Notice the Padding Type and
Padding Style defaults to around:x-small and there are no defaults set for
Margin Type and Margin Size.
k. Select a Bottom Margin Type and set the Margin Size to Medium. Click the +
button.
l. Select a Horizontal Margin Type and set the Margin Size to x-Large. Click the
+ button.
NOTE: The Margin settings may not be immediately visible in the Properties
pane, but you can see them applied on the Canvas.
m. Scroll down to the CUSTOM CSS section. To add a box shadow to the Block
element, copy and paste the below CSS to the Inline CSS Styles field:
n. Click the Clone icon next to the trashcan to clone the Account block.
o. In the Properties panel for the new block, rename the Element Name to
Weather.
There are three ways to add a data field to a state on the canvas that displays data returned
from the data source. All are located in the Build panel:
● Text element – This combines text and parsed merge fields to display on a FlexCard.
● Fields list – Click Fields to view the list of available data fields. These fields are
populated from the data source.
b. From the Build panel, drag a Block element inside the Account block.
NOTE: If you are having trouble placing the block inside the Account block,
position your mouse along the top center of the block and release when you
see the blue line inside it.
e. Drag a Text element below the Icon element inside the Icon Header block.
2. Add the data fields and a menu element for the Account Details.
a. Drag a Text element to below the Icon Header block. Make sure it is outside
the Icon Header block, but still inside the Account block.
You will know if you dragged it into the right place by the name of the block.
The element name will say Icon Header-Text if you dragged it into the Icon
Header block but will say Account-Text if you dragged it into the Account
block.
TIPS:
If you’re having trouble placing an element on the canvas, such as inside or
outside of a Block element, try selecting an element on the canvas so it’s
highlighted, then use that to guide you when placing a new element.
If you don’t place it correctly the first time, move the elements around on the
canvas after they’ve been placed. Note that the element name doesn’t change
after you move it to the canvas, it keeps the name you enter or the name
automatically generated depending on its placement.
c. Drag a Menu element from the Build panel to between the top two Text
elements.
d. Click the Preview button. Click Action Debugger. This allows you to trace the
flow of data from the data source into the FlexCard.
e. You will populate the elements with account data next, so make sure the data
is being brought in from the Integration Procedure you configured. Locate the
first entry for Datasource and expand it. This is the datasource for the
Account block.
f. You will populate the elements with account data next, so make sure the data
is being brought in from the Integration Procedure you configured. Note the
dataSource type is “IntegrationProcedures”. Below it you see the name
team_getAccountContactDetails.
Field Value
Element Name Icon
Icon utility:company
Size Large
Variant Inverse
d. Delete the text in the Extra Class field. The icon didn’t disappear, you only
changed its color to white against a white background.
e. Select the Text element in the Icon Header block. Locate TEXT PROPERTIES
in the Properties panel.
f. Click in the DIV line where it says Edit me! This is placeholder text. Delete it.
g. Leave your cursor in the DIV line so it’s selected. This is the field for the
account name, so it must be large and prominent. Put the merge field for the
account name here.
h. Select AccountName from the Fields menu. This populates the DIV line with
the merge field for the account name.
i. Select Heading Large from the Styles menu. Go to Styles > Headers >
Heading Large.
TIP:
If you do not see the Styles menu, click the two dots (the More menu) to the
right of Div.
The fields in this menu are all pulled from the data source you configured with the wizard.
When working with Text elements, find the fields pulled in by the data source in this menu.
j. If you have not already done so, click the More menu. Highlight the
merge field and bold it.
k. Click the Text color menu and set the text color White. Make sure you
select Text Color and not the Background color menu.
The Icon Header block now looks empty. Don’t worry — you’ll soon see the icon and header
again.
a. Select the Text element under the Icon and Header block.
c. Make a second DIV line for the label to this field. Press Return/Enter on your
keyboard.
d. In the top line, enter Primary Contact for the field label.
i. Select the merge field {AccountPriContact}, then click the More menu
button.
k. Now select the label PRIMARY CONTACT. Set the font size to 10pt.
a. Select the Text element under the Menu element. It has Text-3 in its name.
b. Configure it as follows:
Field Value
Edit Me! Delete and enter a new line
b. Configure it as follows:
Field Value
b. Configure it as follows:
Field Value
Edit Me! Delete and enter a new line
In this task, configure a menu of actions on the Account Details FlexCard using the
Menu element you added earlier.
Field Value
Element Name Menu
Label Menu
Icon utility:down
Enable Overflow ✔
Dropdown Position Right
Variant Neutral
To add actions to the menu, use the + Add New Action button at the bottom of the
Properties panel.
Field Value
Label Edit Account
Icon action:new_account
Field Value
Action Type Omniscript
Omniscript team/editAccount/English
Context ID {AccountId}
d. Click Save.
Once you save the action, find it in the Properties panel at the end of MENU PROPERTIES
and above the Conditions section.
8. Add an OmniScript Action to the menu for updating the account’s primary contact.
a. Click + Add New Action.
b. Configure the Action Properties as follows:
Field Value
Label Change Contact
Icon action:change_owner
team/UpdateAccountPrimaryContact/
Omniscript
English
ContextId {AccountId}
c. Click Save.
Notice the fields are very close together. This is because the elements are not yet
styled.