cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
namit_gupta
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
v-bacao-msft
Community Support
Community Support

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.

Hi Barry,

 

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

 

Regards,

Namit

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (71,611)