All,
I have read the below:
https://powerusers.microsoft.com/t5/Building-Flows/Get-items-Filter-Query-Created/m-p/113917
My flow looks like the below.
There are two issues:
I want to first filter the data to be sent in the CSV file to only contain data on the last seven days for a column entitled “Current Contact Date” so for example if we have a date in that column of 26/12/2018 that will not get selected as the date for today is 04/01/2019, but a date of 31/12/2018 would. At this time all data in the SharePoint list gets included which is understandable as I do not have filter in place. I have tried adding in the filter query either of the following:
Current Contact Date with an expression of adddays(utcnow(),-7)
Or
Current_x0020_Contact_x0020_Date with an expression of adddays(utcnow(),-7)
When I try to use ether of the above I get 400 error.
The second item is in the SharePoint list is a column entitled “source” which is a drop-down list. When the CSV file is generated it shows in the column for that field the following:
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"General Data"}
I just want to show the “General Data" and not the rest is that possible do I need to be looking at a compose type action to strip the rest of this out before using the results of the compose in the CSV file creation.
Any guidance would be appreciated.
Regards,
Andrew
Hi @WDRC,
Do you want to send an email with items that are within a specific date time range?
What’s the column type of Source? Is it a Lookup column or Choice column?
I am not sure how did you input the function in the Filter query field, could you share a screenshot on it?
According to your description, I have made the following flow, please check it for a reference.
Add the button trigger. In your scenario, you could just change it to Recurrence.
Get items from SharePoint list. Input the following code in the Filter query field to filter out items that DueDate on the last seven days.
DueDate le ‘utcnow(‘yyyy-MM-dd’)’ and DueDate ge ‘formatDateTime(addDays(utcNow(),-7),'yyyy-MM-dd')’
Note: Please surround the functions with a single quote.
Then add the action Create SCSV table. Just set Include headers as Yes, and Columns as Custom. Then specify the headers and corresponding value.
Not sure the column type of Resource, so I added a Lookup column and a Choice column in the list. Then I selected dynamic content Lookup value and Choice value for each field.
Then send an email with the CSV table created in previous action. Please make sure enable Yes for Is HTML field.
Screenshots for your reference.
Hope the following doc on Filter query be helpful:
https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)
Best regards,
Mabel
Mabel @v-yamao-msft,
This is very helpful, and is giveing me lot of information on this fliter query, however I am still getting a 400 error, with the following:
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
39 | |
36 | |
34 | |
32 | |
27 |
User | Count |
---|---|
46 | |
36 | |
33 | |
25 | |
22 |