PricingBlog

Colors after formula

  • giantguf-1175088453529128960

    GiantGuf

    2 years ago

    Is it possible to set colors on a text depending on a value of a field?
    I want a text to turn red if the number is higher than a value in another field.
  • Tod-1175088455680794735

    Tod

    2 years ago

    Great energy @GiantGuf! Your continuous contribution to the toddle Community just made you advance to Community Level 4!
  • nocodeable-1175090107435458651

    NoCodeable

    2 years ago

    Seems like you could accomplish this with a formula and custom styles.
  • andreasmoller-1175090623070621767

    Andreas Møller

    2 years ago

    You can add a class like “over-limit” and set it based in the formula
  • Then use the class to style the element
  • giantguf-1175101096465793084

    GiantGuf

    2 years ago

    Hmm.. I'm not quite sure how to do that...
    I have a repeatable row of items and I want only the Target or Stop items to become red if it is above or below the Price value.
    1175101096142843915-image.png
  • gazinhio-1175153666752249866

    gazinhio

    2 years ago

    You add a class in the Attributes tab of the element you want to set the conditional style on. Give it a name and set a formula that returns a boolean value (true or false). This should be a formula that determines if it's above/below the Price value in your instance. In the Styling tab add a new style by clicking the + next to Styles. Select the new style class you added in Attributes from the Class drop-down. Now the styles you set are applicable when the condition you set in the Class' formula are met (returns true). Only set the style properties that you want to be different eg the Font Color.
  • giantguf-1175373480288587776

    GiantGuf

    2 years ago

    Thanks @ , I got it to work! 😀 👍
    👍1