How to set border with formula

When setting a border with a formula/binding, what are the parameters that are needed/how do I set it?

Also, is there documentation somewhere that I would have been able to figure this out on my own? Like a document showing all of the variables/inputs/etc?

1 Like

There is documentation here but it’s a work in progress and you wouldn’t have found this there :slight_smile: Will add it now!

For this specific use case, any of these will work:

  • "3px solid red"
  • "double"
  • "4px dotted #7e3c7e"

What’s important is that you pass a string with a recognizable CSS value for the border property as you would here:

Does that help?

1 Like

Thanks Joyce, you rock!

Yes, I was trying it with something like {style:solid, width:1px, color: #33333}. Wasnt working :slight_smile:

Can you also use a variable from your database to make border color change on value from record?

Nevermind found how you can do it.

Thank you. Is it possible to put a color from the colors set up in the design system?

They are available for binding on the explorer if needed :slight_smile:

Hi, can you please explain how to change the color of the border based on the value of a record? I think that @Riisud found the solution but didn’t share it here. Thank you!

Do you want to use a colour from your design system or hard coded one?

hard coded one would be fine :slight_smile: Thank you

Then you just need to bind to border property, and return a valid css synthax string

Example: “solid 1px #121212

So @aurelie what is the way to set borders with a formula?

Here is what I get when adding a “if” formula for my border color in the CSS syntax string, to change depending on a variable:

Thanks :slight_smile:

You should concatenate both string

concatenate("1px solid ", if(MY_COND, COLOR_1, COLOR_2))

The preview value should show you something like “1px solid #1E3A8A

1 Like

Thank you!