Call to get session ID not working I’ve read the community posts and the developer docs about getting the running user’s session ID using XXX. But I can’t get it working in my JQuery function below. The function runs SOQL database queries based on input text using JQueryUI autocomplete. It needs to make a connection to Salesforce using the session ID, but it fails, giving an error in the console: Uncaught {faultcode:‘sf:INVALID_SESSION_ID’, faultstring:‘INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session’, detail:{UnexpectedErrorFault:{exceptionCode:‘INVALID_SESSION_ID’, exceptionMessage:‘Invalid Session ID found in SessionHeader: Illegal Session’, }, }, } I’ve tested the function by hard-coding the session ID and it works fine, so I just need to nail this issue. Here’s the code, appreciate any help: skuid.$(function() { //Establish a connection to Salesforce using the //sforce.connection.init(sessionID, ServerURL) function. var template = “{{$Api.Session_Id}}”; //This isn’t working! var sid =