Skip to main content

Notifications

Community site session details

Community site session details

Session Id : wmKJ9/3pYjdlziU2QpByzi
Power Apps - Building Power Apps
Unanswered

Sorting Document Library on Created By and Modified by fields

Like (1) ShareShare
ReportReport
Posted on 17 Oct 2024 13:38:35 by 24
Hi All,

I have a gallery connected to a Sharepoint Document Library and I would like to sort the gallery based on the Modified By or Created By Fields.

The following formula is producing an error for Modified By when I add the "Editor" Field to the Sort.  (Error: Cannot Sort on the Expression Type)
 
SortByColumns(Filter(Documents,'File Type - Original' = "Manual" || 'File Type - Original' = "Instructions"
|| 'File Type - Original' = "Template"),"Editor",
If(locSortLoaderDescending,SortOrder.Descending,SortOrder.Ascending))
 
The "ThisItem" for the field in the gallery is :
 
ThisItem.'Modified By'.DisplayName
 
Again, this does not work when "Modified By'.DisplayName" is hard coded into the formula. 

(Error:Specific Column "Modified By'
.DisplayName"  does not exist).

When I try to figure the Sharepoint FileType by clicking sort in the document library it uses " Editor"

(&sortField=Editor&viewid).

Can anyone help me with this and provide the code for Modified By and Created By.

Many Thanks
Jamie


 
Categories:
  • WarrenBelz Profile Picture
    147,384 Most Valuable Professional on 24 Oct 2024 at 23:59:35
    Sorting Document Library on Created By and Modified by fields
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    147,384 Most Valuable Professional on 18 Oct 2024 at 00:55:58
    Sorting Document Library on Created By and Modified by fields
    Try this
    SortByColumns(
       AddColumns(
          Filter(
             Documents,
             'File Type - Original' = "Manual" || 
             'File Type - Original' = "Instructions" || 
             'File Type - Original' = "Template"
          ),
          ModSort,
          'Modified By'.DisplayName
       ),
       "ModSort",
       If(
          locSortLoaderDescending,
          SortOrder.Descending,
          SortOrder.Ascending
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 394 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 193

#3
stampcoin Profile Picture

stampcoin 149

Overall leaderboard
Loading started