cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abieba
Helper III
Helper III

having issues with filtering in get item

Hello Guys,

Please help

I have a list with StaffName (Person or Group)  and a Status (Ongoing, Pending, Completed) Options

Each User has multiple entries into the list

i want to filter get items to pick a user in the StaffName column and also check that Status column is showing Ongoing.

I want the comparison of the StaffName to be the Email Such that i could have a filter
StaffName.Email (like in powerapps) eq 'StaffName DisplayName'     and    Status eq 'Ongoing'



Please help!!!


1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @abieba ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the filter array as below:

@and(equals(item()?['StaffName']?['Email'], 'Test@xxxx.microsoft.com'),equals(item()?['Status']?['Value'], 'Ongoing'))

 

Best regards,

Alice       

Community Support Team _ Alice Zhang
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

6 REPLIES 6
v-alzhan-msft
Community Support
Community Support

Hi @abieba ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the filter array as below:

@and(equals(item()?['StaffName']?['Email'], 'Test@xxxx.microsoft.com'),equals(item()?['Status']?['Value'], 'Ongoing'))

 

Best regards,

Alice       

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


Hello @v-alzhan-msft , 


Thank You for your response.

I have tried this but its returning null and i have a Staff Name Email and Line Manager Email that should match and an approval status showing 'Ongoing'.

niew.JPG

 

@and(equals(item()?['StaffName']?['Email'], triggerBody()?['LineManager']?['Email']), equals(item()?['Status']?['Value'], 'Ongoing'))

Regards,

Anthony.

Hi @abieba ,

 

Could you please share a screenshot of the configuration of your flow?

Could you please explain more details about the expression in the screenshot below:

1.png

 

Best regards,

Alice       

 

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

test screen2.JPG

 

i want to do a filter with two conditions.

GetItems(StaffName.Email) = WhenItemisCreated (LineManager.Email)

and

if the email are same it should do a check for GetItems(LeaveStatus) = Ongoing of the ones that are same. 

@abieba 

While the solution suggested by @v-alzhan-msft will work, I would like to suggest an alternate approach.

See my screen shot below where I use an OData filter to filter the items before they are returned by Get items - no need to filter the array, etc.  Just loop through all items returned and take action as appropriate.

ODataEmail.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @abieba ,

 

Your flow is correct except that the Condition inside the Apply to each is not needed.

Please delete the Condition inside the Apply to each.

 

Best regards,

Alice       

 

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

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

Users online (3,562)