I have a var was stored in localStorage. I want to use it as value of a Request Parameter of RestService. How I should do this?
I have a var was stored in localStorage. I want to use it as value of a Request Parameter of RestService. How I should do this?
If you want to invoke localStorage.getItem then you can write a JavaScript function in mapping. Or, you can map it directly from local storage.
Hi, Max.
Can the two links above be renewed? They don't work anymore.
Also, I was thinking if that (this topic) was a use case of Generic Service?
Thx.
Hello,
you can find new Tiggzi documentation on http://docs.tiggzi.com
Hi, Katya.
So, setting a Generic Service can also achieve the same thing?
Thx.
Hmm...
Back to the point that "to invoke localStorage.getItem then you can write a JavaScript function", can I put loop in the custom javascript section of the request parameter concerned? Like:
precode
var i = 0
for (var i in localStorage){
var value = localStorage.getItem (localStorage);
return '{'+value+'}';
i++;
}
/code/pre
Cheers!
You can generate the only value via JavaScript.
You can write separate JS code for each request parameter.
Hi thanks for replying.
I need to put all the content of the local storage (the image below) that has been saved in the Tiggzi Database on a button click.
How can I do that programatically? Should I create Generic Service (like Max has referred to in https://getsatisfaction.com/tiggzi/to...?
Thankj you.
To execute data source with custom request parameters values use next JavaScript code:
codedatasource1.execute({'data': {
'count': 12
}
});/code
This example shows how to add "count" request parameter to rest service call.
To add all localStorage variable use next code:
codedatasource1.execute({'data':localStorage});/code
Please replace "datasource1" with DataSource component name on "Data" tab.
Sorry, but what do you mean by "DataSource component name on "Data" tab"?
Where exactly are these located?