Display HTTP task response in a form

I have a simple flow
image

A “GET” call that gives a json response, and I want to show the json fields in a form.

However, I am not able to get the field to show up in the form -> how can this be achieved?

I tried accessing it inside the form like so ${.responseBody} but it did not worked.

1 Like

Hi @BCoder

Can you share your process definition?
It will be easier to help you.

Thanks! I was actually able to solve it myself.

I had to set the following property:
image

Hi BCoder,
I want try same use case , Form where you are displayin response is it a form created externally? or form created within flowable moduler?

Can you please share source code as well of this demo?

Thanks in advance!

-Santosh

Hi,

How to print response in Script Activity using JAVA script? I tried with

print(${responseBody}) but it gives error.

Can you add your comments?
-Santosh

Using javascript as language for the script task:

 <scriptTask id="scripttask1" name="Script Task" scriptFormat="javascript">
      <script>java.lang.System.out.println("test")</script>
    </scriptTask>

Thanks for the update

I am able to print any String or message with script task. BUT my question was different.

How to print response recieved from HTTP Task Response withinn Script Task.

Can you please add your comments??

-Santosh

In the http task, there is a setting to store the response as a variable (you need to provide a name). When this is set, you can reference it in the script task later on.