cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.

View solution in original post

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.

View solution in original post

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,796)