Page 1 of 1

xml to json

PostPosted: Sat Jun 04, 2022 9:28 am
by satanete666
Hi,

Is any way to parse a xml structure to json in widget designer?

Regards

Re: xml to json

PostPosted: Sun Jun 05, 2022 5:56 pm
by Daniel Kaminski
Hi,

no, not at the moment.

Daniel

Re: xml to json

PostPosted: Fri Jul 08, 2022 12:17 pm
by Daniel Kaminski
Looks like I was wrong. Our developers pointed out that we do have a command.

Try this command: JsonLoadXmlFileToVar

AThe next release will also support: XMLRequestToVar

Does this help.

Daniel

Re: xml to json

PostPosted: Thu Aug 04, 2022 5:41 pm
by satanete666
Hi Daniel,

Is possible to use this function but reading from a web Page?

Re: xml to json

PostPosted: Tue Aug 09, 2022 4:24 pm
by JustynR
That depends on the web page.
What is the site you're trying to get?

For instance, I use an endpoint for Major League Baseball for an application I've built:

https://statsapi.mlb.com/api/v1/schedule?sportId=1&date=2022-08-09

But, the front 'public' side of their site isn't a simple API:
https://www.mlb.com/schedule/2022-08-09

This public-facing website will load the graphics, then use this API to have the client (your browser) fill in the data.
A lot (most) sites work like this - however, the API is often locked

There are ways to 'scrape' a website and create your own endpoint, but issues will arise if the website you're scraping is updated or changed.

There are also some APIs that allow you to specify the format as well.

Use the "HTTPToVariable" command to get you started.