How to get individual value from REST API returned from Oracle database in the UI

1
0
-1

Hi,

have created a simple REST API call that access the database and returns a JSON object.
I can display the JSON in the form ok, so all that is good.

My question is - how can I access the individuate JSON item, in this case the "greeting" item.

*{"items":[{"greeting":"Hello joe from ORDSTEST"}],"hasMore":false,"limit":25,"offset":0,"count":1,"links":[{"rel":"self","href":"http://development:8080/ords/ordstest/examples/routes/greeting/joe"},{"rel":"describedby","href":"http://development:8080/ords/ordstest/metadata-catalog/examples/routes/g..."},{"rel":"first","href":"http://development:8080/ords/ordstest/examples/routes/greeting/joe"}]}
*
In the form I have define an External API variable "result" that has the value "http://development:8080/ords/ordstest/examples/routes/greeting/joe"

I tried to read the greetings value to a input field using "result.greeting" but that didn't work.

Whats the way to access the JSON object and get the "greeting" to a variable that can then be displays in the form?

Thanks,
ktp

2 answers

1
+2
-1
This one is the BEST answer!

Sorted, the fact that java starts things with zero and not one, did get me.
The code below returned the "greeting" value ok.

result.items[0].greeting

ktp

1
0
-1
Notifications