Sorting on a metadata column

%3CLINGO-SUB%20id%3D%22lingo-sub-2455806%22%20slang%3D%22en-US%22%3ESorting%20on%20a%20metadata%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2455806%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20be%20able%20to%20sort%20(date%20order)%20a%20managed%20metadata%20column%20in%20SharePoint%20online.%20Is%20this%20possible%3F%20I%20haven't%20been%20able%20to%20figure%20it%20out.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2455806%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2457218%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20on%20a%20metadata%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2457218%22%20slang%3D%22en-US%22%3EHi%3CBR%20%2F%3EWhere%20do%20you%20need%20to%20do%20the%20sorting%3F%20Are%20we%20talking%20in%20a%20web%20part%20or%20perhaps%20in%20a%20library%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2458464%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20on%20a%20metadata%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2458464%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F476096%22%20target%3D%22_blank%22%3E%40miclarsen1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20responding!%20Where%20I%20need%20to%20sort%20is%20in%20a%20document%20library%20and%20the%20metadata%20column%20is%20multiple%20lines%20of%20text.%20From%20what%20I've%20seen%2C%20that%20is%20one%20of%20the%20fields%20you%20can't%20sort%20on%2C%20although%20I%20certainly%20don't%20understand%20why.%20We%20have%20been%20filling%20in%20descriptions%2C%20beginning%20with%20a%20date%2C%20hoping%20to%20use%20the%20ability%20to%20sort%20to%20create%20a%20chronology.%20If%20you%20have%20any%20%22secret%20tips%2C%22%20I'd%20love%20to%20hear!%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I need to be able to sort (date order) a managed metadata column in SharePoint online. Is this possible? I haven't been able to figure it out.

7 Replies
Hi
Where do you need to do the sorting? Are we talking in a web part or perhaps in a library?

@miclarsen1 

 

Thanks for responding! Where I need to sort is in a document library and the metadata column is multiple lines of text. From what I've seen, that is one of the fields you can't sort on, although I certainly don't understand why. We have been filling in descriptions, beginning with a date, hoping to use the ability to sort to create a chronology. If you have any "secret tips," I'd love to hear!

@ConnieH_456 as far as I can recall it has never been possible to sort on a managed metadata column.

 

Rob
Los Gallardos
Intranet, SharePoint, Website and Power Platform Manager (and classic 1967 Morris Traveller driver)

You can definitely sort on a managed metadata column - as long as the column does not allow you to enter multiple values. However, it looks like what you are asking about is sorting on a multiple lines of text field, which is not something you can sort on. Based on what you say you want to do, consider one of the following:
- Create a separate column with the date and sort based on that column instead of trying to add a date to the text column
- Create a calculated column to pull out the date in your multiple lines of text field and then sort on the new column. You will want to make sure your dates are all entered in a consistent format such as YYYYMMDD so that the sort will make sense and the function to create the calculated column will work.
- Could you instead sort on an existing attribute such as Modified?

@Susan Hanley 

 

Susan, thank you for your response! Here is an example of an entry in a metadata (multiple lines of text) field:  

"2018-08-27 New Order – 105 kits will arrive tomorrow"

I need to be able to sort on the date; I'm not sure how the calculated column needs to be set up to do this. So, I guess basically what I want is for the new column to pull the date into another column that I can sort on. Does that make sense? I truly appreciate your help.

Looks like you can't create a calculated column from a multiple lines of text field. If this column needs to remain multiple lines of text, I would recommend that you add a new column to enter the date that you are currently embedding in the Multiple Lines of Text field. However, if you can switch the column to be a single line of text field, you can use the following formula in your new Calculated column. Create a new column called Update Date or something like that and for the formula, type =LEFT([Column Name],10). You can actually make this a Date column by selecting Date as the type of column to be returned. Then, you will be able to sort Newest to Oldest (or vice versa) on your new Update Date column. You can continue to use the same format for entering your text and the data will be extracted into the new column. This is not going to work if you need to retain more than 255 characters in that text column, however. If what you are trying to sort on is when the row got updated last, just sort on Modified Date. You may also be able to create a flow to extract the first 10 characters and add it to a new column as well and keep the column multiple lines of text. I'm trying to answer your specific question but honestly, there may be a totally different and more effective way to accomplish your outcome goal. You may want to consider a PowerApp.
Thanks, Susan.