0

Dynamic color in calendar

I'm trying to set a formula that changes the color of an appointment on calendar.

I have the field FASE DI with this formula:

if 'Check-In' > Evento.Inizio then
styled("SMONTAGGIO", "orange", "", "")
else
styled("MONTAGGIO", "red", "", "")
end

 

So if I insert in the field SHOW AS of the Data

'Fase di'

I can see the label on the calendar with the right text and color

Schermata 2020-06-25 alle 17.32.47

but I need to see more text infos in the label so I inserted 

 

'Fase di' + " " + Evento.Evento + " - " + 'Nr. persone' + " persone"

I don't have any error in the formula but it doesn't appear like I will but so:

Schermata 2020-06-25 alle 17.31.01

 

Maybe because the other fields hasn't the same color?

Is there a way out to make this works together without applying the color on the other fields?

 

Or maybe, is it possible to make a formula that set a different colorlabel in the calendar depending if DATE1 is before DATE2 of that record?

Thanks

7 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    If you use styled, all the fields must be of the same type. For example a number and a text field won't work. You can use text(numberfield)+Textfield though.

    Steven

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    PS: If you want to fill the dates between 'Check-in' Date and 'Check-out' Date in your calendar you need an appointment field. Let's assume your appointment fields name is 'Period' you can put something like this in the trigger after update of your 'Check-out' date field:

    Period := appointment('Check-in','Check-out')

    Steven

    • Walcher_Messebau_GmbH
    • 3 yrs ago
    • Reported - view

    Thank you Steven!! I decided to remove the color from the field FASE DI? I've checked and it works but I need to see in red on the Calendar the reservations that have the check-out before the date of Start Event, otherwise in orange. Maybe it will be easyer if the color is Red when the result of the field FASE DI is MONTAGGIO or orange if not. Can you help me with the formula? 😅

     

    PS you saved me from a lot of work with the trigger of the PERIOD ;)

    thank you for your help

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Maybe this helps:

     

    Steven

    • Walcher_Messebau_GmbH
    • 3 yrs ago
    • Reported - view

    Thank you Steven! I will try in a week because I am away now! I let you know if this works 😊

    • Walcher_Messebau_GmbH
    • 3 yrs ago
    • Reported - view

    Hi Steven. I fixed the problem now.

    I've putted on the period-field this formula in the field SHOW AS:

     

    if 'Check-In' > Evento.Inizio then
    styled("Smontaggio " + Evento.Evento + "-" + 'Nr. persone' + " persone", "orange")
    else
    if 'Check-In' < Evento.Inizio then
    styled("Montaggio " + Evento.Evento + "-" + 'Nr. persone' + " persone", "red")
    else
    styled("Cancellato", "black")
    end
    end

    Schermata 2020-07-07 alle 15.09.27

     Thank you for your help ;)

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    👍

Content aside

  • 3 yrs agoLast active
  • 7Replies
  • 1065Views