bind table from json array

1
0
-1

I'm a new in Bonita bpm. I receive data from my connector in the form as a json string.
There is like connector output param. I store this param like pool variable.
Then, i get this value with external api:

../API/bpm/activityVariable/{{taskId}}/response_rows[enter image description here][1]

I got json array like :

[{"reason":"reason","createdBy":"4","endDate":"2018-11-23T00:00:00+0000","persistenceId":"1","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-15T00:00:00+0000","createtionDate":"2018-11-21T05:56:02+0000"},{"reason":"reason","createdBy":"4","endDate":"2018-11-23T00:00:00+0000","persistenceId":"2","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-16T00:00:00+0000","createtionDate":"2018-11-21T06:01:26+0000"},{"reason":"test","createdBy":"4","endDate":"2018-11-16T00:00:00+0000","persistenceId":"3","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-16T00:00:00+0000","createtionDate":"2018-11-21T07:26:57+0000"},{"reason":"reason","createdBy":"4","endDate":"2018-11-23T00:00:00+0000","persistenceId":"33","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-22T00:00:00+0000","createtionDate":"2018-11-21T13:25:35+0000"},{"reason":"1111","createdBy":"4","endDate":"2018-11-17T00:00:00+0000","persistenceId":"34","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-17T00:00:00+0000","createtionDate":"2018-11-21T13:26:58+0000"},{"reason":"rrr","createdBy":"4","endDate":"2018-11-30T00:00:00+0000","persistenceId":"35","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-09T00:00:00+0000","createtionDate":"2018-11-21T13:29:37+0000"}]

I can create json variable from this json and set it as a data source.
I see that everything works fine. But when I set the data as External API variable nothing is displayed in the table.

I use the expression of my variable and not a constant (a small button in the content setting).

How can I show json array as a table ? Is it possible in bonita system ?

1 answer

1
0
-1

Did you find the answer to this. I'm facing the same issue.

Comments

Submitted by michele.pantano on Thu, 01/17/2019 - 17:12

me too

Submitted by mehrdad.behrooz... on Thu, 01/17/2019 - 21:25

The way I got around this is to create a JavaScript Expression variable that looped through the JSON reply from the API call and took out the information I wanted. I found that Bonita does not like reading through JSON arrays so while you could reference {{variable.detail}} if the JSON reply was {"name":"Jack", "address":"123 road"}, the same would work if the JSON that is returned is enclosed in [] - eg. [{"name":"jack", "address":"123 road"}].

Submitted by antoine.mottier on Mon, 01/28/2019 - 16:43

Can you maybe clarify what you are trying to achieve? Do you want to display some data in a Bonita task form? Or use the data as part of a connector execution? Recommendation might be different depending on your constraint (where and how data are currently stored) and what you are trying to achieve. So giving more indications about your use case will help me to provide a better answer. Thanks.

Notifications