cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crf5200
Level: Power Up

ODATA Filter on a Sharepoint Get Items

I feel like I'm spinning in the same loop on a project. I'm trying to use the 'Apply_to_each' columns from one Get Items action to filter a child Get Items Action. Is there a way this is possible.

 

The Parent Get Items pulls in the company credit card transactions that get loaded up into a sharepoint list. The Child Get Items I want to pull the submitted receipts from the card holder that meet the following:

 

Amount = Amount

Matched = false

TransDate < PostingDate

TransDate >= PostingDate-6

 

This is the OData I've come up with on the Child Get Items:

 

Matched eq bool(false) and Amount eq items('Apply_to_each')?['Amount'] and Transaction_x00200_Date lt items('Apply_to_each')?['Posting_x0020_Date'] and Transaction_x00200_Date lt addDays(items('Apply_to_each')?['Posting_x0020_Date'], -6)

 

I know I'm the noob that created his lists with spaces, lesson learned. I've tried playing with the format on the Dates, working on the false boolean, and keep coming back to this error.

 

{
  "status"400,
  "message""The expression \"Matched eq False and Amount eq 15 and Transaction_x0020_Date lt 07/02/2018 and Transaction_x0020_Date ge 06/26/2018\" is not valid.\r\nclientRequestId: 0667323e-6289-4704-9c62-a981fbb0b304\r\nserviceRequestId: cf22789e-10ad-6000-fd20-b722f0742ad5"
}

 

I'm trying to update captured information from receipt submissions to be able to properly code credit card expenses without the arduous task of emailing the card holders endlessly to get more info on each transaction.

 

Please help me figure out what I'm doing wrong.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Bizzo
Level 8

Re: ODATA Filter on a Sharepoint Get Items

For your transaction date, this is something similar that I have running. I know this works. I don't see why you'd have to set the variable (Timestamp - 1 hour ago that shows up as Output) like I did, but if you do the addDays directly in the filter query you'll need to have the single quotes.

 

Microsoft Flow SharePoint Get Items Filter by date timestamp

6 REPLIES 6
Bizzo
Level 8

Re: ODATA Filter on a Sharepoint Get Items

Have you tried breaking down your filter query into separate pieces to see which ones are actually working? If individual conditions aren't written correctly, they'll all fail. For example, I think you're missing single quotes on the date comparison.

 

Transaction_x00200_Date lt addDays(items('Apply_to_each')?['Posting_x0020_Date'], -6)

 

Transaction_x00200_Date lt 'addDays(items('Apply_to_each')?['Posting_x0020_Date'], -6)'

 

Can you break down each criteria and make sure each works and then focus on the one(s) that don't work?

crf5200
Level: Power Up

Re: ODATA Filter on a Sharepoint Get Items

The Error is definitely on the Date Filters:

 

{
  "status"400,
  "message""The expression \"Transaction_x0020_Date lt 2018-07-02\" is not valid.\r\nclientRequestId: 24dc39f4-d5be-4025-9bd7-7953da2ec167\r\nserviceRequestId: 0133789e-6021-6000-1e89-046f6e6223b5"
}

Highlighted
Bizzo
Level 8

Re: ODATA Filter on a Sharepoint Get Items

For your transaction date, this is something similar that I have running. I know this works. I don't see why you'd have to set the variable (Timestamp - 1 hour ago that shows up as Output) like I did, but if you do the addDays directly in the filter query you'll need to have the single quotes.

 

Microsoft Flow SharePoint Get Items Filter by date timestamp

crf5200
Level: Power Up

Re: ODATA Filter on a Sharepoint Get Items

Capture.PNG

 

I added the single quotes around the date expressions and that did the trick. Thank you everyone for your help!

yamane95
Level: Powered On

Re: ODATA Filter on a Sharepoint Get Items

Hi! I'm running into a similar problem, but this solution isn't helping me. Are the dates in your column in the SharePoint list saved as a Single line of text or as a Date and Time? 

crf200
Level: Powered On

Re: ODATA Filter on a Sharepoint Get Items

They are set up as Date/Tine data fields.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 161 members 4,660 guests
Please welcome our newest community members: