Hello,
I have an image gallery of attachments Items = LookUp(List,ID=glbCurrentRecord.ID).Attachments
These attachments get these names depending on what they are for, Sort 1 -Now(), Sort 2 -Now(), Set 1 -Now(), Set 2 -Now(), Shine 1 -Now(), Shine 2 -Now() and so on. I want to sort this gallery just in this order Sort (1,2,3,ect), Set (1,2,3,ect), Shine (1,2,3,ect). I think this could be done with something like this.
SortByColumn(LookUp(List,ID=glbCurrentRecord.ID).Attachments,Left(DisplayName,Find("-",DisplayName)-1),["Sort","Set","Shine"]) or maybe something with a StartsWith but I can't seem to get it to work.
Can someone point me in the right direction?
Thanks
Solved! Go to Solution.
Hi @StephenGW ,
Not straight-forward - the below allows for two number spaces (up to 99) and should work as long as a single number has a space after it, I have not tested, so you might have to adjust the number positions slightly
Sort(
LookUp(
List,
glbCurrentRecord.ID
).Attachments,
With(
{
wSep:
Find(
"-",
DisplayName
)
},
Left(
DisplayName,
wSep - 1
) &
Mid(
DisplayName,
wSep + 1,
2
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @StephenGW ,
A bridge too far . . . it is complex enough just doing it alphabetically.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@WarrenBelz I think I figured it out! I was wondering if you could look at this with your expertise and see if there are any potential problems you see with this?
SortByColumns(AddColumns(LookUp('5s Audits',ID=glbCurrentRecord.ID).Attachments,"SortName",Left(DisplayName,Find("-",DisplayName)-3)),"SortName",["Sort","Set","Shine","Stand","Sus"])
Added a column that only contains the name minus the numbers and anything else then sort by that column. I will try to add another column with the number and use that as the secondary sort?
Thoughts?
Thanks
Hi @StephenGW ,
Not straight-forward - the below allows for two number spaces (up to 99) and should work as long as a single number has a space after it, I have not tested, so you might have to adjust the number positions slightly
Sort(
LookUp(
List,
glbCurrentRecord.ID
).Attachments,
With(
{
wSep:
Find(
"-",
DisplayName
)
},
Left(
DisplayName,
wSep - 1
) &
Mid(
DisplayName,
wSep + 1,
2
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
This appears to sort them by the number at the end. I need the first sort to be in this order Sort, Set, Shine, Stand, Sus and then a second sort by the number. Is this possible?
Thanks
Hi @StephenGW ,
A bridge too far . . . it is complex enough just doing it alphabetically.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@WarrenBelz I think I figured it out! I was wondering if you could look at this with your expertise and see if there are any potential problems you see with this?
SortByColumns(AddColumns(LookUp('5s Audits',ID=glbCurrentRecord.ID).Attachments,"SortName",Left(DisplayName,Find("-",DisplayName)-3)),"SortName",["Sort","Set","Shine","Stand","Sus"])
Added a column that only contains the name minus the numbers and anything else then sort by that column. I will try to add another column with the number and use that as the secondary sort?
Thoughts?
Thanks
User | Count |
---|---|
254 | |
106 | |
95 | |
50 | |
39 |