cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Get Items and OData Filter

I am trying to use an OData Filter in my Get Items from SharePoint.  I would like to filter to only show items that are not in status Final Approval.  But I can't find the correct syntax.  The output from the query currently pulls all items.  The field name is Prepared_x0020_for_x0020_approva (it is a Choice column type) and I have tried using

  • ne 'Final Approval'
  • lt 4
  • ne '{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":4,"Value":"Final Approval"}'

Any suggestions on how to get only items that are not in Final Approval?

Full Output for each "item" includes: 

{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":15,"Value":"2019A1234"},"Audit_x0020_Name_x003a_Audit_x00#Id":15,"Prepared_x0020_for_x0020_approva":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":4,"Value":"Final Approval"},"Prepared_x0020_for_x0020_approva#Id":4,"{Identifier}":"Lists%252fAudit%2bDetail%252f16_.000","{IsFolder}":false,"{Thumbnail}":{"Large":null,"Medium":null,"Small":null},"{Link}":"https://xxx.sharepoint.com/sites/DWJoshTest/Audit/_layouts/15/listform.aspx?PageType=4&ListId=304cb018-8414-487d-9e43-fd57892d4dde&ID=16&ContentTypeID=0x0100DC2F2FF593E7B742BE70140C5DCE7F2F","{Name}":"Accounts Receivable","{FilenameWithExtension}":"Accounts Receivable","{Path}":"Lists/Audit Detail/","{FullPath}":"Lists/Audit Detail/16_.000","{VersionNumber}":"2.0"},{"@odata.etag":"\"1\"","ItemInternalId":"17","ID":17,"Title":"Accounts receivable","Audit":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":15,"Value":"Great Plains of America"},"Audit#Id":15,"Audit_x0020_Name_x003a_Audit_x00":

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

That didn't work either, but it did get me thinking about whether if I used eq 'Final Approval' if that would give me the opposite of what I am trying to get and it did.  So then I tried to just do "or" between the wrong values and that worked!

 

(Prepared_x0020_for_x0020_approva eq 'Not Ready') or

(Prepared_x0020_for_x0020_approva eq 'Test Plan Ready') or

(Prepared_x0020_for_x0020_approva eq 'Test Plan Approved') or
(Prepared_x0020_for_x0020_approva eq 'Work Performed Ready')

 

So not ideal, but it is working! 

View solution in original post

4 REPLIES 4
Memorable Member
Memorable Member

Try this:

Preparedforapprova ne 'Final Approval'

Let me know how it goes.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

Solution Sage
Solution Sage

Update: oops, this post is wrong, filters on choice fields are used as they are: column eq 'value'

 

When you check the output you shared, you'll see that the column contains an object.

image.png

...so you can't use just the column as it is, you need to use that column's property 'Value' in the condition.

 

Prepared_x0020_for_x0020_approva/Value eq 'Final Approval'

 

That didn't work either, but it did get me thinking about whether if I used eq 'Final Approval' if that would give me the opposite of what I am trying to get and it did.  So then I tried to just do "or" between the wrong values and that worked!

 

(Prepared_x0020_for_x0020_approva eq 'Not Ready') or

(Prepared_x0020_for_x0020_approva eq 'Test Plan Ready') or

(Prepared_x0020_for_x0020_approva eq 'Test Plan Approved') or
(Prepared_x0020_for_x0020_approva eq 'Work Performed Ready')

 

So not ideal, but it is working! 

View solution in original post

Hi @sarah_kuhn 

 

The correct syntax is as follows

 

Prepared_x0020_for_x0020_approva ne 'Final Approval'

 

I did tested this now and worked as expected.

 

May I ask you that is this a List library or document library?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (11,009)