cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Post Prodigy
Post Prodigy

Gallery sort filter not working

Hello

 

On my Gallerys Items property I have the following, this was working fine (it has a delegation warning):

 

Filter(Sort(ListName,
'Created By'.Email = VarUser || 
VarUser = AssessorName.Email ||
VarUser= ManagerName.Email ||
VarUser= "Email1" ||
VarUser= "Email2"|| 
VarUser= "Email3"|| 
VarUser= "Email4"|| 
VarUser= "Email5", Descending),
StartsWith(YourName.DisplayName,tbSearchInput.Text) // Search box, searcing by applicant name
)

 

 

I have approx 140 items in the SP list, and as i mentioned this was working the last time i checked with a test account, and now its displaying everything for everyone which causes me major issues, cant see why this has occurred, any ideas please?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Lefty ,

I can see some syntax issues in there - is this what you are trying to do?

 

Sort(
   Filter(
      ListName,
      (
         'Created By'.Email = VarUser || 
         VarUser = AssessorName.Email ||
         VarUser= ManagerName.Email ||
         VarUser= "Email1" ||
         VarUser= "Email2"|| 
         VarUser= "Email3"|| 
         VarUser= "Email4"|| 
         VarUser= "Email5"
      ) &&
      StartsWith(
         YourName.DisplayName,
         tbSearchInput.Text
      )
   ),
   YourSortOrderField,
   Descending
)

 

 

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.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @Lefty ,

I can see some syntax issues in there - is this what you are trying to do?

 

Sort(
   Filter(
      ListName,
      (
         'Created By'.Email = VarUser || 
         VarUser = AssessorName.Email ||
         VarUser= ManagerName.Email ||
         VarUser= "Email1" ||
         VarUser= "Email2"|| 
         VarUser= "Email3"|| 
         VarUser= "Email4"|| 
         VarUser= "Email5"
      ) &&
      StartsWith(
         YourName.DisplayName,
         tbSearchInput.Text
      )
   ),
   YourSortOrderField,
   Descending
)

 

 

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.

View solution in original post

Hi @WarrenBelz 

 

Yes That seems like what I need, I got rid of the sort function and now only the data which should be visible to a user is.

The problem is, the oldest record is on top, not as bad as having everyone see everything.

 

I've attempted to try your suggestion, getting an error in the code;

Invalid number of arguments received 1 expected 3

@Lefty ,

Free-typed on iPad - one bracket in wrong place now corrected.

 

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.

Hi @WarrenBelz 

 

Hopefully a very simple question, can I not use values from a choice column to be searchable, i.e. :

when I put this line in, it works, but it presents a blue line, advising of a delegation warning:

StartsWith(YourName.DisplayName, tbSearchInput.Text ||
         StartsWith(CourseRoom.Value, tbSearchInput.Text)



Hi @Lefty ,

I assume YourName.DisplayName is a Person Field. You have several Delegation issues with your code.Try this

Sort(
   Filter(
      AddColumns(  
         ListName,
         "aCourse",
         CourseRoom.Value,
         "aName",
         YourName.DisplayName,
         "aCreated",
         'Created by'.Email
      ),
      (
         VarUser = aCreated || 
         VarUser = AssessorName.Email ||
         VarUser= ManagerName.Email ||
         VarUser= "Email1" ||
         VarUser= "Email2"|| 
         VarUser= "Email3"|| 
         VarUser= "Email4"|| 
         VarUser= "Email5"
      ) &&
      (  
         StartsWith(aName,tbSearchInput.Text) ||
         StartsWith(aCourse,tbSearchInput.Text)
      )
   ),
   YourSortOrderField,
   Descending
)

 

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.

 

@WarrenBelz 

Apologies, I have mixed up 2 different questions.

 

Thanks for your response, but I have asked my follow up question in the correct post 😀

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,436)