Hello community, I need your assistance. I'm trying to make a SOQL query to Salesforce, where I need to pass a variable. This variable is dependant on a selector that chooses a specific state. Based on the chosen state, the query changes. This method works seamlessly with any SQL request I make, but faces issues with Salesforce requests. The system informs me that I can't proceed without binding or something similar.
Interestingly, if I hardcode text like "Montana", the request is successful. However, when I include variables (which are added on the retool part), the request fails. Is there a way to convert this to a final request before it's actually sent to Salesforce?
SELECT Name, Credentials__c
FROM Account
WHERE PersonMailingState = {{ selectState.value}}
LIMIT 200
Does not work
With error message:" Therapist' AND PersonMailingState = Montana ^ ERROR at Row:3:Column:84 Bind variables only allowed in Apex code"
BUT
SELECT Name, Credentials__c
FROM Account
WHERE PersonMailingState = 'Montana'
LIMIT 200
WOKS!!!! WHYYY???