Forum Discussion
Create a Refinable managed property which contain a Date field + choice field
I have a sharepoint online date field named DueDate of type Date/Time that allow to enter Date Only (without time).
And i choice field named DueDatetime with these values:-
12:00 AM
12:30 AM
1:00 AM
1:30 AM
2:00 AM
2:30 AM
3:00 AM
3:30 AM
4:00 AM
4:30 AM
5:00 AM
5:30 AM
6:00 AM
6:30 AM
7:00 AM
7:30 AM
8:00 AM
8:30 AM
9:00 AM
9:30 AM
10:00 AM
10:30 AM
11:00 AM
11:30 AM
12:00 PM
12:30 PM
1:00 PM
1:30 PM
2:00 PM
2:30 PM
3:00 PM
3:30 PM
4:00 PM
4:30 PM
5:00 PM
5:30 PM
6:00 PM
6:30 PM
7:00 PM
7:30 PM
8:00 PM
8:30 PM
9:00 PM
9:30 PM
10:00 PM
10:30 PM
11:00 PM
11:30 PM
now can i create a refinable managed property that combine the values of both fields to generate a date & time field? so i can search, filter and sort items based on this refianble value?
so if i have a combination of the 2 columns as follow:-
22 August 2024 9:00 pm
22 August 2023 11:00 am
and i sort them descending then
22 August 2024 9:00 pm
should be shown before
22 August 2023 11:00 am
is this possible? to manage inside sharepoint search?
- michalkornetIron Contributor
I understand that this question relates to the previous one about the managed property. Since we’ve confirmed that a calculated column can be used as a string, perhaps you could create a calculated column that checks if the time in choice filed is PM (and if so, adds 12 to the hours) to achieve a date format like '2024-09-11T07:00:00Z.' This should allow you to sort the values.
For filtering, you could create separate calculated columns to extract values for year, month, day, and hours, which could then be used for filtering.