cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
denise_martinca
Helper II
Helper II

Filter gallery depending on the app user

Hi, everyone! I have made an app that should assign employees' requests to different members of the company depending on the manager. I've got 2 lists: 1)It is called "Retornoflexible_1", it contains all the requests and one of the columns is "Legajo" which is the requester's ID, text type. 2)It is called "TablaEmpleados", it contains all the employees' ids (USERID), their email (EMAIL) and manager's id (MANAGER). I would like to filter a gallery with all the requests depending on who is logged in. I would need to look up the requester's id on Retornoflexible_1, obtain the manager´s id, then look up the manager´s id and get it's email. After that, I may filter the gallery. I used this code in the items property of the gallery but it keeps failing.

Filter(RetornoFlexible_1;LookUp(TablaEmpleados;LookUp(TablaEmpleados;Legajo=USERID;'MANAGER')=USERID;'EMAIL')=User().Email)

I think that I have the problem with "Legajo" reference but I'm not sure what I am doing wrong.

Captura.JPG

Thank you in advanced!!!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @denise_martinca ,

Could you please share a bit more about your scenario?

Do you want to list all available requests which are assigned to current sign in user inside your Gallery?

Further, does the "Legajo" column in "Retornoflexible_1"List match the USERID column in your "TablaEmpleados" List?

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Gallery to following:

Filter(
       RetornoFlexible_1;
       LookUp(
              TablaEmpleados;
              USERID = LookUp(TablaEmpleados; USERID = Legajo).MANAGER
       ).EMAIL = User().Email
)

Note: I assume that each "Legajo" column from "Retornoflexible_1"List could only match single one record in your "TablaEmpleados" List. The USERID column is a unique type column (without duplicates) in your "TablaEmpleados" List. And the USERID column and the MANAGER column store similar value.

 

Of course, I think the Addcolumns function could also achieve your needs. Please consider try the following workaround:

Filter(
       AddColumns(
               AddColumns(
                        RetornoFlexible_1;
                        "ManagerID"; LookUp(TablaEmpleados; USERID = Legajo; MANAGER)
               );
               "ManagerEmail"; LookUp(TablaEmpleados; USERID = ManagerID; EMAIL)
       );
       ManagerEmail = User().Email
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @denise_martinca ,

Could you please share a bit more about your scenario?

Do you want to list all available requests which are assigned to current sign in user inside your Gallery?

Further, does the "Legajo" column in "Retornoflexible_1"List match the USERID column in your "TablaEmpleados" List?

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Gallery to following:

Filter(
       RetornoFlexible_1;
       LookUp(
              TablaEmpleados;
              USERID = LookUp(TablaEmpleados; USERID = Legajo).MANAGER
       ).EMAIL = User().Email
)

Note: I assume that each "Legajo" column from "Retornoflexible_1"List could only match single one record in your "TablaEmpleados" List. The USERID column is a unique type column (without duplicates) in your "TablaEmpleados" List. And the USERID column and the MANAGER column store similar value.

 

Of course, I think the Addcolumns function could also achieve your needs. Please consider try the following workaround:

Filter(
       AddColumns(
               AddColumns(
                        RetornoFlexible_1;
                        "ManagerID"; LookUp(TablaEmpleados; USERID = Legajo; MANAGER)
               );
               "ManagerEmail"; LookUp(TablaEmpleados; USERID = ManagerID; EMAIL)
       );
       ManagerEmail = User().Email
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much!! I used this code and it worked perfectly!!!!!!!

Filter(
       AddColumns(
               AddColumns(
                        RetornoFlexible_1;
                        "ManagerID"; LookUp(TablaEmpleados; USERID = Legajo; MANAGER)
               );
               "ManagerEmail"; LookUp(TablaEmpleados; USERID = ManagerID; EMAIL)
       );
       ManagerEmail = User().Email
)

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,041)