cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sachinsoni441
Level: Powered On

Filter Not Work In PowerApps

Hello Everyone,

 

I have one SharePoint list which have two column Manager, Manger2..

 

Error.jpg

I want to check, if User login in PowerApps, that user exist or not in Manager Column. if exist filter gallery by Manager else Filter Gallery by Manager2.

 

My Approch is:

If(
    IsEmpty

    ( 
        LookUp(
                 EmpAndApprover,
                                     User().Email in Manager.Email
     )
 ),

 

Set(CustomGalleryFilter,
        SortByColumns

        (
                   Filter(
                       ExpenseMasterList,
                                Manager1 = User().Email,
                                        Status = "Submitted" || Status = "Approved By Approver1" || Status = "Final Approved"
                           ),

                               "ID", Descending
                         )
      ),
  Set(CustomGalleryFilter,
            SortByColumns

                (
                  Filter(

                               ExpenseMasterList,
                               Manager2 = User().Email,
                               Status = "Approved By Approver1"
                          ),"ID",Descending
                  )
        )
);

 

But this formula is not working properly.

 

Please Provide any workground.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter Not Work In PowerApps

Hi @sachinsoni441 ,

Can you show me the error message  ?

What’s the column type  ofstatus ?

What’ the column type of Manager1?

 

I assume that Manager1 is Person or Group type. “Status column is choice type .

 

If so, I think that there’s something wrong in your formula

 

I have made a test . It worked

I create a sharepoint list named test4 (  EmpAndApprover) and another list named test5 ( ExpenseMasterList)

6.PNG

Set Items property of BrowseGallery1 to : CustomGalleryFilter

Set Onstart property of BrowseScreen1 to : 

If(
    IsEmpty(
        LookUp(
            test4,
            User().Email in Manager.Email
        )
    ),
    Set(
        CustomGalleryFilter,
        SortByColumns(
            Filter(
                test5,
                Manager1.Email = User().Email,
                status.Value = "Submitted" || status.Value = "Approved By Approver1" || status.Value = "Final Approved"
            ),
            "ID",
            Descending
        )
    ),
    Set(
        CustomGalleryFilter,
        SortByColumns(
            Filter(
                test5,
                Manager2.Email = User().Email,
                status.Value = "Approved By Approver1"
            ),
            "ID",
            Descending
        )
    )
)

Regards,

Eason

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

Re: Filter Not Work In PowerApps

Hi @sachinsoni441 ,

Can you show me the error message  ?

What’s the column type  ofstatus ?

What’ the column type of Manager1?

 

I assume that Manager1 is Person or Group type. “Status column is choice type .

 

If so, I think that there’s something wrong in your formula

 

I have made a test . It worked

I create a sharepoint list named test4 (  EmpAndApprover) and another list named test5 ( ExpenseMasterList)

6.PNG

Set Items property of BrowseGallery1 to : CustomGalleryFilter

Set Onstart property of BrowseScreen1 to : 

If(
    IsEmpty(
        LookUp(
            test4,
            User().Email in Manager.Email
        )
    ),
    Set(
        CustomGalleryFilter,
        SortByColumns(
            Filter(
                test5,
                Manager1.Email = User().Email,
                status.Value = "Submitted" || status.Value = "Approved By Approver1" || status.Value = "Final Approved"
            ),
            "ID",
            Descending
        )
    ),
    Set(
        CustomGalleryFilter,
        SortByColumns(
            Filter(
                test5,
                Manager2.Email = User().Email,
                status.Value = "Approved By Approver1"
            ),
            "ID",
            Descending
        )
    )
)

Regards,

Eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
sachinsoni441
Level: Powered On

Re: Filter Not Work In PowerApps

Working now!

Thanks @v-sheyu-msft

mehul_sompura
Level: Powered On

Re: Filter Not Work In PowerApps

i have two column requester and manager.

 

i want to filter, that manager can see all the requeste sent out but requester can only see his own request.

 

i have used this approch Requester.DisplayName = User().FullName, but cann do it with if condition using manager

mehul_sompura
Level: Powered On

Re: Filter Not Work In PowerApps

If(Manager.Email = User().Email, Manager.DisplayName = User().FullName, Requester.DisplayName = User().FullName )


i used this formula and it works!!

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 381 members 4,265 guests
Please welcome our newest community members: