web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using if in filter que...
Power Automate
Unanswered

Using if in filter query of sharepoint get items

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi 

 

I need to filter the query in get items of sharepoint on following conditions

Emptyglasses_0-1676015256121.png

 

 

Could anyone please check and confirm whether is there any error in the formula

Condition I required  if the Select Type Value is "Request for self" I need to filter Title column with Vertical , if not Title Column with Company Code 

Spoiler (Highlight to read)

And>
<Eq>
<FieldRef Name="@{outputs('Get_item_-_User_Info')?['body/SelectType/Value']}" />
<Value Type="Text">Request for self</Value>
</Eq>
<Eq>
<FieldRef Name="Title" />
<Value Type="Text">@{outputs('Get_item_-_User_Info')?['body/Vertical']}</Value>
</Eq>
</And>

<Or>
<Not>
<Eq>
<FieldRef Name="@{outputs('Get_item_-_User_Info')?['body/SelectType/Value']}" />
<Value Type="Text">Request for self</Value>
</Eq>
</Not>
<Eq>
<FieldRef Name="Title" />
<Value Type="Text">@{outputs('Get_item_-_User_Info')?['body/CompanyCode']}</Value>
</Eq>
</Or>

And><Eq><FieldRef Name="@{outputs('Get_item_-_User_Info')?['body/SelectType/Value']}" /><Value Type="Text">Request for self</Value></Eq><Eq><FieldRef Name="Title" /><Value Type="Text">@{outputs('Get_item_-_User_Info')?['body/Vertical']}</Value></Eq></And><Or><Not><Eq><FieldRef Name="@{outputs('Get_item_-_User_Info')?['body/SelectType/Value']}" /><Value Type="Text">Request for self</Value></Eq></Not><Eq><FieldRef Name="Title" /><Value Type="Text">@{outputs('Get_item_-_User_Info')?['body/CompanyCode']}</Value></Eq></Or>

Could anyone please help me to fix this 

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,713 Super User 2026 Season 1 on at

    Wrong syntax 😉

    Check "oData query"

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Could u please be detail about the error

  • Chriddle Profile Picture
    8,713 Super User 2026 Season 1 on at

    oData filters require a different type of syntax.

    It should look like: ((Title eq 'test') and (Date gt '2024-01-01') or Title eq 'TTT')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard