cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Salesforce action ODATA query

Hi Experts,

 

I am querying Salesforce through MS-Flow. There are certain date fields in the Salesforce on which I intend to filter my results.

 

When i use the 'Get Records' action in the Salesforce and apply an ODATA filter on the records

 

Screenshot 2019-03-02 at 1.56.48 PM.png

 

I am getting the following error message:

 

Salesforce failed to complete task: Message: 
eStaff_To_Do__c FROM Case WHERE (Data_Migration_Created_Date__c <
                                 ^
ERROR at Row:1:Column:8607
value of filter criterion for field 'Data_Migration_Created_Date__c' must be of type date and should not be enclosed in quotes
clientRequestId: ec00b7ed-def2-4c74-8c1d-80a6598a4732

 

The date is in yyyy-MM-dd format in salesforce. Can anyone point me in the right direction to resolve this issue?

 

Regards,

Namit

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Salesforce action ODATA query

Hi @namit_gupta ,

 

When configuring Filter Query, if the field type is String, you need to add single quotes outside the string value.

Try adding a single quotation outside of the timestamp, as below:

Data_Migration_Created_Date__c lt '2018-12-02'

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor

Re: Salesforce action ODATA query

Hi Barry,

 

I tried the mentioned filter. It is giving the same error.

 

Regards,

Namit

Highlighted
Community Support
Community Support

Re: Salesforce action ODATA query

Hi @namit_gupta ,

 

Could you share a screenshot of the action configuration?

 

Please ensure that the type of the field is eligible.

In addition, you could try not to configure Filter Query, execute Get records action, and observe how this field is displayed in Body.

Then configure the name of this field in Filter Query.

And follow the previous rules, if the comparison parameter is String or Date, need to add single quotes outside.

 

If this method still doesn't work, you could use Filter array to filter records instead of using Filter Query.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (5,691)