dornz
Posts: 0
Joined: Thu Apr 05, 2012 9:11 pm

REST Service from Javascript

How do I call a REST service that I created in the ui from Javascript? How do I get the results of this call in Javascript?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service from Javascript

code
service_name.execute({});
/code

You should still map the service, so you can display the result on a page.

dornz
Posts: 0
Joined: Thu Apr 05, 2012 9:11 pm

REST Service from Javascript

Output from a service call can only be mapped to a grid/list or a local storage variable, which iterates over the results. I just want the results. I have attempted to map the results to a local storage variable and add to a string on each iteration but this causes unexpected behavior (white screen or app goes back to start page). I just want to know how to get the results in javascript so I can do something like:
service_name.execute({});
var results = service_name.results

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service from Javascript

You could use service's success event to get the data it returns: http://help.tiggzi.com/documentation/...

dornz
Posts: 0
Joined: Thu Apr 05, 2012 9:11 pm

REST Service from Javascript

That works! Awesome support Max! Thank you!

dornz
Posts: 0
Joined: Thu Apr 05, 2012 9:11 pm

REST Service from Javascript

Hi Max,

One other related question: I would like to make some modifications to the result set (such as sorting) before mapping the output to a list on the screen. I tried making these changes in the success event but the changes don't get reflected when mapped to the list. Any suggestions?

Ed Chmiel
Posts: 0
Joined: Fri Jun 27, 2014 11:58 pm

REST Service from Javascript

FYI that page is gone, can you report the correct url?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

REST Service from Javascript

Here you are: https://getsatisfaction.com/apperyio/...

// also there is a link in the bottom of the above link - here is correct reference: https://getsatisfaction.com/apperyio/...

Return to “Issues”