My search query is Processing_time_in_days__c = null AND (Status = 'New' OR Status = 'In progress')
I select the option “Return first search result” but the test still returns thousands of records, so I cannot send the fields to open AI to analyze (too many characters, and Open AI has a limit).
Why is it happening?
Best answer by SamB
Sorry to hear you’re getting a “MALFORMED_QUERY” error with that approach @Mikey Long! I had a closer look into this and it appears there’s actually two very similar actions for searching Salesforce by query:
The Find Record by Query action has a field that looks like it should allow you to set the maximum number of records that are returned:
Can you try setting that field to 1 and let us know whether that does the trick?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.
It sounds like the query is overriding the “Return first search result” setting. I’d recommend flagging that with our Support Team in case it’s a bug: https://zapier.com/app/get-help
In the meantime, you can try reducing the number of results returned by adding a LIMIT clause to your query. For example you’d want something more like:
SELECT Processing_time_in_days__c, Status FROM YOUR_OBJECT_API_NAME_GOES_HERE__c WHERE Processing_time_in_days__c = null AND (Status = 'New' OR Status = 'In progress') LIMIT 1
I added Limit 1 to the query and Zap returns an error message 😭
Failed to find a record in Salesforce
Salesforce returned a MALFORMED_QUERY error. Please make sure you are entering valid data or use the help link below to contact Zapier support for more information / assistance.
Sorry to hear you’re getting a “MALFORMED_QUERY” error with that approach @Mikey Long! I had a closer look into this and it appears there’s actually two very similar actions for searching Salesforce by query:
The Find Record by Query action has a field that looks like it should allow you to set the maximum number of records that are returned:
Can you try setting that field to 1 and let us know whether that does the trick?
That’s great news, @Mikey Long! 🎉 I’m so pleased that other search action did the trick. Do reach back out if you run into any trouble setting up the next steps in your Zap. In the meantime, happy Zapping! 😁⚡