Page 1 of 1

Save query service response as Local Storage Variable array

Posted: Mon Apr 28, 2014 8:10 pm
by Yan Yi

Hello! I passed a where parameter and using the test function, and I got more than one response (multiple rows of the collection being returned). This works correctly.

How to map it in such a way that I can save a query service response to a LSV as an array? The below mapping only returns one value.
Image


Save query service response as Local Storage Variable array

Posted: Mon Apr 28, 2014 9:38 pm
by Maryna Brodina

Hello!

Please take a look here https://getsatisfaction.com/apperyio/...


Save query service response as Local Storage Variable array

Posted: Mon Apr 28, 2014 10:06 pm
by Yan Yi

Thanks for your reply!

For the method stated in the link, I would need to use the list widget. How do I get it to loop (meaning fetch more than one row in the collection) using the query service and LSV only? I am only getting one value.


Save query service response as Local Storage Variable array

Posted: Tue Apr 29, 2014 1:15 am
by Igor

Hello,

Please add mapping like on the screen shot.

http://prntscr.com/3ef9hb/direct

You should also delete this link:

http://prntscr.com/3ef9vv/direct

After you delete it you would have in your "sheduleToDelete" LSV a correct JSON string of whole service response.

Note: if you want to use it as object you should to parse it before. Example code:
pre

//Get an object from string stored in LSV.
var scheduleToDeleteObject = JSON.parse(localStorage.getItem("scheduleToDelete"));

//Using of object.
console.log(scheduleToDeleteObject.length);
/pre


Save query service response as Local Storage Variable array

Posted: Tue Apr 29, 2014 1:42 am
by Yan Yi

Thanks!