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
Super User III
Super User III

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 😙

Super User II
Super User II

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'

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ ... and if you like my response, you might like also the tips and solutions on my Power Automate related blog ]

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (18,208)