I have a script-task using the HTTP-Connector that requests a specific url.
Now I want to write some Response-Properties to the camunda-workflow variable…
My expected response body:
{
id: 'some-guid'
}
I want to write the id to the documentId variable:
How do I archive that?
And how to handle getting a date?
Update (22.03.2022)
I found in a forum following snippet to add in connector tab under output parameters:
var response = connector.getVariable("response");
var json = S(response);
var deadlineProp = json.prop("deadline");
deadlineProp.value();
But then I get following error:
org.camunda.bpm.engine.ScriptEvaluationException: Unable to evaluate script:org.camunda.spin.spi.SpinDataFormatException: SPIN-01004 No matching data format detected
at org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.evaluate(SourceExecutableScript.java:71)
at org.camunda.bpm.engine.impl.scripting.ExecutableScript.execute(ExecutableScript.java:63)
at org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:99)
at org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:87)
at org.camunda.bpm.engine.impl.delegate.ScriptInvocation.invoke(ScriptInvocation.java:47)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:58)
at
How can I fix it?