Yan Yi
Posts: 0
Joined: Sat Jan 25, 2014 7:38 pm

Save query service response as Local Storage Variable array

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

Yan Yi
Posts: 0
Joined: Sat Jan 25, 2014 7:38 pm

Save query service response as Local Storage Variable array

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.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Save query service response as Local Storage Variable array

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

Return to “Issues”