how to retrieve a value from javascript in camunda output parameter ?
I am calling a REST service using http-connector and am getting the response as JSON object.
I want to parse the response in javascript and get the value from it.
I want to get that o/p value in the next activiti, so how can i keep that in process again in javascript ?
my javascript code looks like below
@sunkiranforu when using the Http-connector set your output variable with a inline JS where you have S(response) . This uses Camunda’s “spin framework” which will parse the JSON string into a JSON object.
If you just want to keep the userID as your output variable do something like S(response).prop("userid");
Hi…I am also trying to do the same thing…
Hitting the Url and then getting a JSON Response…Now I want to Use Values from that JSON response and display in the form.
But in the Tasklist I am getting below error:
**An error happend while submitting the task form : ** Cannot submit task form e974bf48-92bf-11e6-99c6-d43d7ec7ada1: Unable to evaluate script: sun.org.mozilla.javascript.internal.EcmaError: SyntaxError: Empty JSON string (#1) in at line number 1
Consider Below as the JSON Response:
{
“recordSetTotal”: “1”,
“resourceName”: “productview”,
“recordSetComplete”: “true”,
“recordSetStartNumber”: “0”,
}
Need Help…
HI Tushar,
I am also trying similar one ,get the response and display in the form .if you have completed could you please share me the code.
thanks,
Bala
HI Stephen,
I need some help .
1.crete Embedded HTML and inserted into USER task form
2.Read the USER’s input and call the REST service (POST).
3.In another form I want to display the REST response (JSON).
Please let me know how to do that,I didn’t see anywhere this implementation .