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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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