Hi,
We need a Bubble app to convert XML files to different formats. Is anyone interested in doing this?
Hello @rogerbretyne
We’ll be glad to help you out with this. Check your PM please and feel free to leave your request on our website, or just email us at projects@ezcode.co .
Regards EzCode Team !
Hi Roger,
I have worked extensively with XML files in the past and would be glad to help.
Feel free to reach out to me on andrewjohnson56782@gmail.com
Best Wishes,
Andrew
Hi, you can use a XML to JSON converter server side action, it’s quite easy to implement, and once you get it to JSON format or even then to a normal Javascript object you can do pretty much anything with it, here’s the code:
// so you grab the node library that gives this functionality
var convert = require('xml-js');
// now you convert the XML to JSON format
let result = convert.xml2json(xmlString, {compact: true, spaces: 4});
// Optional, do this only if useful (probably will be), now you convert that JSON to a normal Javascript object
let asObj = JSON.parse(result);
// do whatever you want with the object
console.log(asObj);
Dear Roger,
Will be happy to help you with this. Please connect with me at jonesanna050@gmail.com
Best
Is it possible to initialize a api request (xml) with the api connector and utilize the ‘XML-js’ library to parse the results? Or do the results need to come back in Json format?
Not possible to use what I provided from the API connector, only from a server side action.
whats a good way to accompish this? without having to use a 3rd party like webtask.io (parsing xml responses)
Using Bubble’s server side action feature, like I said… requires coding, however.
LOL. That doesn’t look easy to me. Where does one even begin to set something like that up?
Hahah well… create a new plugin, open it in the plugin editor, create an action, choose server side in the dropdown, paste that in the code area.
Then replace console.log(asObj);
with the code that performs what you want done. Or even skip the optional step and use result
which is the XML converted to JSON in a stringified form in case that’s what you want to work with.
This is the a hidden benefit of Bubble - you get to learn things as you go
If you keep struggling, let me know, will try to walk you through it
Hi @funwtp Very true. I’ve got a lot of the basic bubble actions figured out, but when it comes to anything beyond that I get lost pretty quickly. Thanks for your offer! I may take you up on it.