I assumed your script runs fine with the hard coded values?
Have you checked that the dollar sign expansion replaces your variables with text values in the same format as the hard coded values?
Maybe add a date format:
let vtemp = Date(Today(1),'DD-MM-YYYY');
let vtempP = Date(Today(1)-1,'DD-MM-YYYY');
let vprofileId = 'XXXXXXXX';
Thanks for the help ,It is working fine , what I notice If i use your idea and put a variable of Today's date , It works fine now but later or next day it shows me error like data has been not loaded. Can you please tell me how to fetch data from a particular date to today , as I am looking to create an application which fetch data until today. But I don't wana do all the stuff , like go to QV source every time , select query there ,copy code and paste it here, If this I need to do , this is not a real time application.
Please help me as this is an urgent requirement.
If you do it manually and then compare the code with the variables being expanded (you should see this in the script editor debug window), do you see any differences?
Do you get a specific error message when running the code multiple times?
Maybe there is a limitation from the data source provider in the number of times you can call the API.
Thanks a lot, your suggestion are really helpful. What i Noticed , we must run first QVSource and then run authenticate after that if we run the script it loads the data from Google Analytics Source. So Now the question is Do I need to run always QVSource manually or there is any way which makes qv source always run at back end , for this time I am using a desktop application , May be on server side , If i run QVSource once so it will always run at back end. Please correct me if I am on wrong Path.