greg keys
Posts: 0
Joined: Wed Sep 25, 2013 4:32 am

what is the Javascript under LocalStorage in REST mapping used for?

what is the point of the javascript in the REST mapping area under the localStorage area on the right side, when you edit it, it shows function(value, element) I can see that if you map to it as if it were an element or localstorage variable the value represents the mapping but what is the element for?

Can I use this to dynamically map to various elements based on the response? ie say a type could be friend, group, document, etc.. can i use this javascript to determine which elements get mapped based on a response type?

greg keys
Posts: 0
Joined: Wed Sep 25, 2013 4:32 am

what is the Javascript under LocalStorage in REST mapping used for?

I dont see anything on that page which explains the purpose for the javascript below the localStorage variables, the documention you reference refers to the JS which can be attached to request, response and elements but not the section below localstorage

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

what is the Javascript under LocalStorage in REST mapping used for?

Hello! While mapping to localStorage variable "element" function parameter is undefined. You can put any JS code, you'll get in value parameter corresponding part of response and implement any custom logic based on this data.

Return to “Issues”