I need to sort a widget list by a Text, Single field that holds a date.
I can’t put date into a proper date field as field also has text.
I can sort on the text in the field as is in format dd/mm/yyyy, but it is sorted in the wrong order.
I have created a composite that holds a formatted copy of the date say in ANSI format so I can sort? yyyy/mm/dd – but it uses 4 composites?
Anyone have any ideas as to how I can sort by date without using 4 composites?
Thanks
JonathanFS
Hi @JonathanFS ,
The text single line base format is simply a string, so it’s going to order based on the value within the text, as text. What you would need is to extract the data out of the text single line to then order by.
There’s also the question of how you want to order - Is it by the “Order” setting within the listing widget’s settings, or as a column within the listing.
If it’s the former, you’ll need to extract the date out of the text in a property or composite.
If it’s the latter, you can use the extracted field as a column in the listing OR select an existing column and specify the extracted date in the Alternative order field (this will order the listing by that column, based on this setting, instead of by the original values in the column)
In either case it looks like you’ll need to extract the date - Which you’re doing through 4 composites I presume.
I was going to say you could use the Field’s Date/Time format composite function to display your date, but you’ve mentioned the date also has text? Can you describe how so, or provide an example, so I can better assist you?