cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter by user

Guys, i'm using this code: 

 

If (Label5.Text = "Name" && TextSearchBox2_2.Text = ""; SortByColumns(Filter (DB_Sharepoint; User =  "Name1" );"Employer";Ascending);
If (Label5.Text = "Name" && TextSearchBox2_2.Text = "Divergente"; SortByColumns(Filter (BDSharepoint;Status= "Divergente";User =  "Name1");"Status"; Ascending);
Search(
        BD_Sharepoint;
        TextSearchBox2_2.Text;
        "User"
    )
))

 

My label5 is the name registered on office 365, basicaly i'm trying to builter  my galery based on who is using
If name = Ed sheeran, will show only Items from John jones
If name = Naruto, will show only items from Game of thrones. 

i have 5 employers that will use this app, so i have to filter for all 5 of them, so i will need to use 10 IF's, (If;cond;true;(If;Cond;True;(If;Cond;True;.......)
And when i use more than 3 ifs inside one if, it gives me an error. 
Can somebody help me with this?

1 ACCEPTED SOLUTION

Accepted Solutions
KrishnaV
Super User
Super User

Hi @Anonymous ,

 

Nope you can use Switch for this:

Switch (TextSearchBox2_2.Text, 
"Divergente", "for user Divergente",
"User-2", "for user User-2",
"User-3", "for user User-3",
"User-4", "for user User-4",
"User-5", "for user User-5",
"for all the user as default condition)

I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

1 REPLY 1
KrishnaV
Super User
Super User

Hi @Anonymous ,

 

Nope you can use Switch for this:

Switch (TextSearchBox2_2.Text, 
"Divergente", "for user Divergente",
"User-2", "for user User-2",
"User-3", "for user User-3",
"User-4", "for user User-4",
"User-5", "for user User-5",
"for all the user as default condition)

I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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