Best answer

Using a variable in Salesforce / SOQL Query?

  • 16 July 2020
  • 2 replies
  • 1482 views

Userlevel 1

Hello!

I’ve run into a possible issue with finding records using Salesforce via an SOQL Query.  I could use some help figuring this out.

The big picture is that my Zap is triggered when our telephone system receives a phone call.  I’m trying to use the incoming phone number to look up a contact in Salesforce.

The information provided by my trigger includes a caller id. When looking at my Task Log, it appears to be correct:

 

If I “hard code” the caller ID into a Salesforce SOQL Query, I get the results expected.  But if I refer to the dynamic caller id supplied by the trigger’s output, I get nothing.

This example, which is just for testing purposes, works only if the second line of the query is present:

 

Here’s the Salesforce SOQL query shown in the Task Log:

 

It is possible that those template variables were not evaluated? I’m talking about:

{{58867260__data[]caller_id_number}}

Any help would be much appreciated

icon

Best answer by PaulKortman 17 July 2020, 01:26

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +10

@BretTruchan you are on to something when you asked:

It is possible that those template variables were not evaluated? 

 

But it’s not that they were not evaluated, it’s that they had no value. When looking in Task history and you see curlies {{variable name here}} then what that is telling us is that Zapier found nothing for that Value. It was empty or null. 

 

So the next thing to look at is the output of step 1 in that task history and find out why caller_id_number is empty/missing.

Userlevel 1

Thanks Paul! That pointed me in the right direction.  I was referencing the wrong template variable.  (In this case, I’m using a custom App that apparently needs a bit of work. :smile: