cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShaneITAutomate
Post Patron
Post Patron

Sorting or addcolumn by a Text and Numbers column in a collection

Hi,

 

I have a collection (colTEST) i made from a sharepoint List (TESTLIST) in where the naming convention of a column (TESTID) is is AB1 to AB900

 

I believe (is there a better way) that the best way would be to remove the AB or add a column so i can sort by it. however the code im using just doesnt work,

 

could someone help as this code doesnt work

 

ClearCollect(colTEST, AddColumns(TESTLIST,
"SORTID",
Mid(colTEST.TESTID, 3, 10)
)

 

any suggestions would be appreciated

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ShaneITAutomate 
Consider this:

ClearCollect(colTest,Sort(AddColumns(Table1, "sortid",Substitute(TESTID,"AB","")*1),sortid,Descending))

 

Or
ClearCollect(colTest,Sort(AddColumns(Table1, "sortid",Substitute(TESTID,"AB","")*1),sortid))
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

Hi @ShaneITAutomate 

ClearCollect(
              colTest, Sort(
                             AddColumns(TESTLIST, "sortid", 1*Mid(
                                                                   TESTID,3
                                                               ),
                             ), sortid
                         )
)

Hi @ShaneITAutomate 
Consider this:

ClearCollect(colTest,Sort(AddColumns(Table1, "sortid",Substitute(TESTID,"AB","")*1),sortid,Descending))

 

Or
ClearCollect(colTest,Sort(AddColumns(Table1, "sortid",Substitute(TESTID,"AB","")*1),sortid))
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,675)