Page 1 of 1

Dynamic query data in Rest Service ?

Posted: Thu Aug 02, 2012 4:41 pm
by Emmz

Updating database using multipal local storage variables.. ? eg.

INSERT INTO 'tech_activity' ('Tech ID', 'Date Time Posted', 'REF', 'Activity Type', 'Activity Info') VALUES ("value1","value2","value3","value4","value5")

When I can't map more than 1 item (values) to the query.

I tried This {TechActivityURL}?key={key}+query={query} in the Rest service URL but it places "+" in the spaces of the query

Basically...
I want the URL loaded from LocalVar(I can do that)
also The query and values from LocalVars and or input Fields..

Any suggestions?
Thanks again for your help !


Dynamic query data in Rest Service ?

Posted: Thu Aug 02, 2012 6:29 pm
by maxkatz

If I understand the question correctly, for request parameters, you can get data from local storage using its API:

code
localStorage.getItem('key');
/code


Dynamic query data in Rest Service ?

Posted: Thu Aug 02, 2012 7:33 pm
by Emmz

You mean in JS like this?
return INSERT INTO 'tech_activity' ('Tech ID') VALUES ("localStorage.getItem('ID')") ;
etc


Dynamic query data in Rest Service ?

Posted: Thu Aug 02, 2012 7:38 pm
by maxkatz

Yes, or first set it to a variable and then use in query.


Dynamic query data in Rest Service ?

Posted: Fri Aug 03, 2012 1:02 am
by Emmz

I used direct localStorage.getItem('ID') within the return statment and it works perfect !!
Thanks again Max !