function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
elstokeyelstokey 

How do I reference Excel cell content within an SForce Connector call function.

I have a list of contact names in an Excel spreadsheet and want to use the Connector to check if these contacts are already in Salesforce.

I figured I could do this using the soql_table function. But instead of typing the name into the formula:
=soql_table("Contact","FirstName = 'Mike' and LastName = 'Stokey' ")
I was hoping to have the formula reference cells in the spreadsheet to find the names. I thought it would look like this:
=soql_table("Contact","FirstName = " & C3 & " and LastName = " & B3 & " ")
But that did not work. It gave me an error message: "unexpected token: Mike"

Can anyone tell me what I am doing wrong?

Thank you.
Best Answer chosen by Admin (Salesforce Developers) 
Ron HessRon Hess
try this, you were very close, note the single quotes around the cel references:

=soql_table("Contact","FirstName = '" & C3 & "' and LastName = '" & B3 & "' ")

your first example had the quotes around the names, this shows how you can insert the same
quotes around the cell references

All Answers

Ron HessRon Hess
try this, you were very close, note the single quotes around the cel references:

=soql_table("Contact","FirstName = '" & C3 & "' and LastName = '" & B3 & "' ")

your first example had the quotes around the names, this shows how you can insert the same
quotes around the cell references
This was selected as the best answer
jambujambu
i think you need a single quote surrounding the cell address
=soql_table("Contact","FirstName = '" & C3 & "' and LastName = '" & B3 & "' ")
crudboycrudboy

Ron,

Do you now how I would add % (wlldcard) to this example.

 

I've been trying

 

=soql_table("Account","Name like ' " & "%" & B2 & "%" & "' AND BillingCountry='AU'")

 

I get an NF# with the above. However, in the same query using AccountName% the right ID is returned.