Page 1 of 1

How do you initiate javascript after a REST service completes?

Posted: Sun Jan 25, 2015 5:50 am
by Patrick Kelly

This may be a stupid question, but I have programmed javascript that pulls information from a field that is populated via a REST service. I have tried setting the event order after the REST service, but the script appears to run before the REST service can populate the field. As a result, my output is blank. How can I delay my javascript to run only once the REST service is complete?


How do you initiate javascript after a REST service completes?

Posted: Sun Jan 25, 2015 5:59 am
by M&M

You can drag and drop / change the order - in your success mapping actions. If you want your JS to run after the mapping, then you'd just need to drag the mapping behind the mapping (Actually it's the default sequence i believe), in this order

You'd normally have your JS code running in the success event. The complete event fires after the execution is complete - irrespective of whether the REST call failed or was successful.
Image


How do you initiate javascript after a REST service completes?

Posted: Sun Jan 25, 2015 6:02 am
by Patrick Kelly

I didn't even think about that. Thanks for the help!