cancel
Showing results for 
Search instead for 
Did you mean: 

SAP FIORI: How can I access data from URL which is accessed from calling API (JSON data)

Former Member
0 Kudos

Hello All,

I am new to SAP FIORI. I have to call web service having JSON Array and JSON objects. In this JSON ARRAY we have element named URL as HTML pages. We have to fetch data from these HTML pages and display that data in list. JSON as follows:We have "results" JSON array, in this we have "url" tag having MAIN URL. And from this MAIN URL we have to fetch data. This url opens an HTML page and to open this we have to use some credentials.

{
"d" : {
"results" : [
{
"__metadata" : {
"uri" : "https://some url", "type" : "data"
}, 
"url" : "MAIN URL"
}]}}

Accepted Solutions (0)

Answers (1)

Answers (1)

Joseph_BERTHE
Active Contributor
0 Kudos

Hello,

What I understand your requirements, here is what you should do.

Your JSON you show use can be accessed through JavaScript like this

Var myMainURL = myJson.d.results[0].url

With this, you can do in JavaScript :

Window.location = myMainURL;

Regards,

Former Member
0 Kudos

Thanks Joseph for your response.

As specified in my JSON, I need to get the data from that MAIN URL which is an HTML page. Do this line

Window.location = myMainURL;
will work for me.