In a gallery, I have a "status" field displayed, which changes it's value based on case progression. I have been asked to have the text color of that item change based on date fields: "DateAssigned" and "DateDue", which are typically about two weeks apart. I've not been successful with trying to modify other date specific 'if' commands to change the color, and any help would be appreciated.
Ideally, the color would start green and remain that color for 7 days, then turn yellow for the next 7 days, then red after the due date.
Solved! Go to Solution.
Hi @bsamms ,
Could you please share a bit more about your scenario?
Are there two weeks difference between the "DateAssigned" field and "DateDue" field?
Further, do you want to change the Color of the "Status" Label Text based on the "DateAssigned" field and "DateDue" field?
I have made a test on my side, please consider take a try with the following workaround:
I assume that there are two weeks difference between the "DateAssigned" field and "DateDue" field. Please set the Color property of the "Status" Label inside the Gallery to following:
If(
DateDiff(ThisItem.DateAssigned, Today()) <= 7,
Color.Green,
DateDiff(ThisItem.DateAssigned, Today()) > 7 && DateDiff(ThisItem.DateAssigned, Today()) <= 14,
Color.Yellow,
DateDiff(ThisItem.DateAssigned, Today()) > 14,
Color.Red
)
Note: It is not necessary to compare with the "DateDue" field value in above formula.
You could also consider try the following formula:
If(
Today() <= DateAdd(ThisItem.DateDue, -7),
Color.Green,
Today() > DateAdd(ThisItem.DateDue, -7) && Today() < ThisItem.DateDue,
Color.Yellow,
Today() > ThisItem.DateDue,
Color.Red
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
Hi @bsamms
You can use an IF Condition to do that.
try this,
LabelSTATUS -> Color
If(ThisItem.Status = "some value", RGBA(0; 255; 0; 1), RGBA(255; 0; 0; 1))
Regards!
@bsamms wrote:In a gallery, I have a "status" field displayed, which changes it's value based on case progression. I have been asked to have the text color of that item change based on date fields: "DateAssigned" and "DateDue", which are typically about two weeks apart. I've not been successful with trying to modify other date specific 'if' commands to change the color, and any help would be appreciated.
Ideally, the color would start green and remain that color for 7 days, then turn yellow for the next 7 days, then red after the due date.
Sorry, i didn't see that.
try this
LabelSTATUS -> Color
If(DateDiff(ThisItem.DateField,Today()) < 7, RGBA(0, 255, 0, 1), If(DateDiff(ThisItem.DateField,Today()) > 7, RGBA(255, 255; 0, 1)))
Hi @bsamms ,
Could you please share a bit more about your scenario?
Are there two weeks difference between the "DateAssigned" field and "DateDue" field?
Further, do you want to change the Color of the "Status" Label Text based on the "DateAssigned" field and "DateDue" field?
I have made a test on my side, please consider take a try with the following workaround:
I assume that there are two weeks difference between the "DateAssigned" field and "DateDue" field. Please set the Color property of the "Status" Label inside the Gallery to following:
If(
DateDiff(ThisItem.DateAssigned, Today()) <= 7,
Color.Green,
DateDiff(ThisItem.DateAssigned, Today()) > 7 && DateDiff(ThisItem.DateAssigned, Today()) <= 14,
Color.Yellow,
DateDiff(ThisItem.DateAssigned, Today()) > 14,
Color.Red
)
Note: It is not necessary to compare with the "DateDue" field value in above formula.
You could also consider try the following formula:
If(
Today() <= DateAdd(ThisItem.DateDue, -7),
Color.Green,
Today() > DateAdd(ThisItem.DateDue, -7) && Today() < ThisItem.DateDue,
Color.Yellow,
Today() > ThisItem.DateDue,
Color.Red
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
41 | |
36 | |
30 |
User | Count |
---|---|
240 | |
74 | |
71 | |
69 | |
65 |