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.

View solution in original post

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,528)