I have a gallery of records that track hours. The color of text in 3 Text Input Boxes changes based on a preset calculation (i.e. current hours +40). They turn Red to alert that action needs taken.
I want to sort Gallery items by records with text that is red. (I have 3 fields in each record that can turn Red)
Any suggestions on best way to sort records this way? I don't see a way to sort by text color of a specific field. I've been thinking I could set a variable (High priority, Low Priority, then sort the gallery by that) that changes when the color of the text changes, but haven't been able to identify what syntax/formula to use in what field to create the variable.
Thank you, I'll try that. I've never used "Mark"
Hi @Spaderk,
Sorry for the late reply.
I think I have got you. You just want to make the records with the red font color display front,right?
To achieve this, maybe we could try something different, we could mark the records that has red font color, and sort the mark.
I don't have a priority set, I was thinking I could if that would help, but I haven't figured out how to set it to change as the text color would change. How would you set a variable in that case? Currently the text box "Color" field has this formula in it:
If(
(Value(ThisItem.'Current Hours')>=Value(ThisItem.'Greasing Due'-5)),Color.Red,Color.Black)
I'm not sure where to add the variable to make it High or low, that was just an idea I thought I could make work.
Gallery is currently sorted by Field Title (#FB3, #FB2, #E801)
Here's an example of the record set at 0.
When Current Hours Text Input Box gets updated to "40"
Grease Due: "40" TURNS RED
When Current Hours Text Input Box gets updated to "400"
Oil Change Due "400" TURNS RED
When Current Hours Text Input Box gets updated to "8760"
Brakes Due "8760" TURNS RED
I'd like to be able to sort the Gallery so that items with the red numbers are showing first. I don't currently have them set with a priority. I've thought about doing that as a variable, but haven't done that. Hope that helps.
Hi @Spaderk,
Do you want to sort by some special items in your Gallery?
Could you please tell me that how you configure the relationship between priority and color?
Actually, we could customize the sort order by a customized table. For example, you can sort record based on the name of a day of the week by supplying [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] as the sort order. All records which have Monday" will come first, followed by Tuesday, and so on.
SortByColumns( Data, "WeekDay", [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] )
You could add a temporary column to assign different priority for different text color, like red color for High priority and other color for low priority, so we could sort gallery items by:
SortByColumns( Data, "Priority", [ "High Priority", "Low Priority" ] )