[SOLVED] XML/JSON Explorer

Hello,

Ive been trying to get the XML Explorer blockspring plugin to work. I can get it to work if I stay away from using dynamic data, but run into problems if the url I input into the plug in is dynamic at all. Ive created a page that shows the workflows Ive been using:
https://forum_app.bubbleapps.io/version-test/custom_url_shortener?debug_mode=true

In the top section is the workflow I am trying to get to work. Based on an input, a long url is created with a button. The input should populate the billing first name on the link created. Then a second button will shorten the url using our own domain (please do not copy this workflow to your apps!). Occassionally it will create a short url, but will not keep the input’s info that was created from the long url. In most cases an error pops up that bubble ran into an error.

In the bottom section is the same shortening workflow but with a static url. This workflow works.

Anything I’m doing wrong?

1 Like

I think in this case … you are the first one to climb this particular peak :slightly_smiling:

thanks, while the overall workflow is pretty complicated, the problem could be as simple as I am typing in the wrong way a dynamic url.

I’ve noticed that if I copy paste the url I am trying to send to the XML blockspring plugin and paste it into blockspring’s own tester, it will work. see: https://open.blockspring.com/pkpp1233/xml-json-explorer. Be sure to either delete the [“channel”][“item”] in the second input for it to work or replace it with [“result”][“url”].

I dont think it is an error with blockspring, but something to do with dynamically composing a url link in bubble for this plugin. Bubble is fine with composing(joining text strings into a url) a dynamic url when I make a link element for example, but not for this plugin it seems.

However even if I edit the link so that I dont have to append any text to it when it is submitted to the XML exporer plugin it still fails. The same link can be inserted into blockspring and it works, but not using bubble…

Oddly, if I put the link as text into the plugin (static url example) it will work in bubble, but not if it is a dynamic link:

Solved! It turns out that I had to first encode the link that was being passed to the XML Explorer. The link that I had sent to it previously had a number of spaces and special characters like ‘&’. Blockspring has an encode url plugin that I had to apply first to get it to work. A link with special characters may work in a browser, but not for this function.

5 Likes

Greetings @hvac_designer

I’m trying to incorporate an API’s information to my app, but it returns an XML format. I need to convert the XML to JSON after I call the function. Can you leave a detailed explanation of what you did exactly for yours. Thanks!

In my example of my api call there was a url parameter that determined if it returned JSON or XML. Essentially in my api call it was a long url and at the end it would say either ?format=xml or ?format=json. My api call could go either way so I just set it to JSON. Perhaps it is a setting in the external api program that you are working with if it can send json instead of xml.

This tool is similar one XML Formatter

I have same problem, xml api on website I want to use, so xml is returned.
Did you resolve ?