top of page
OmniStudioFactBg.png
Search

Conditional CSS on the Flex Card Configuration

  • Writer: Dinesh Kumar
    Dinesh Kumar
  • Jun 8, 2023
  • 1 min read

Now we can do conditional CSS on the Flexcard configuration itself.

We are trying to display a block with different border colors based on a node from the JSON:

a. Added the below custom JSON to the Flexcard data source.

ree

b. Under the Style tab of the Block, added below stylings for the border (This will behave as Default styling, when the other conditions are not satisfied).

ree

c. You can find a button labeled “Add Conditional Styling” on the style section.

ree

d. Click on it and add the condition as shown below and add the border styling as well accordingly for Red.

ree
ree

e. Let's add the same condition and styling for Green color.


ree
ree

f. After configuring the conditions, the Style section will look like below.


ree

g. Now on giving a preview, you can find the response like shown below. The border colors are displayed based on the “displayColor” node value, If the value on the node is not matching with the condition, then the Default style will be taken into consideration.


ree

 
 
 

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