Forum Discussion
Rebek2210
Jan 26, 2023Copper Contributor
Sorting in numerical sequence
Hi everyone. I am trying to figure out how I can sort a library in the proper sequence and I can’t seem to find a way to make it happen.
My files in one of my libraries have alphanumerical names. I would like to sort them so that CSOP-1 is followed by CSOP-2 and so on. My issue is that I seem to only be able to sort all files with a 1 on the first position after the dash before moving to the next digit (as you can see in the picture). Is there any way around this?
Thank you in advance! Really appreciate the help.
- SvenSieverdingBronze Contributor
Hi Rebek2210,
you could turn your "Task ID" column into a number column and apply the following JSON formatting on that column{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "='CSOP-'+@currentField" }
Then it would look the same, but you can sort numerically by it.
Best Regards,
Sven - RobElliottSilver Contributor
Rebek2210 sorting in SharePoint has always been like this for 20+ years. You need to add zeros before the numbers to sort it correctly. So CSOP-001, CSOP-002 etc.
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)