how to config XML: Convert XML to JSON with input from an email trigger?

Options
SHI_172837
SHI_172837 Posts: 12
edited April 2020 in Questions

I tried with bodytext or attachment as input of XML: Convert XML to JSON, it returned below error: "The "XML" that was inserted was invalid, please make sure you have valid XML to parse?"
the XML I attached is
<?xml version="1.0" encoding="UTF-8"?>TRAVEL-859815John Li888888880000667435truefalseBusiness - DomesticShenzhen2020-05-052020-05-15falseEconomy ClassfalseShenzhen POE golive

Tagged:

Best Answer

  • SHI_172837
    SHI_172837 Posts: 12
    Answer ✓
    Options

    @Jozef_783863 , thank you for your reply. I forgot to mention that it worked for me as well when I pasted XML text directly in to the "XML" field. but it did not work if I put field reference of bodytext / attachment from an email trigger. I will send more details via help@catalytic.com. thanks.

Answers

  • SHI_172837
    Options

    the xml code can not be displayed correctly! attach the screenshot for reference

  • Jozef_783863
    Jozef_783863 Posts: 331 admin
    Options

    @SHI_103138, my test with your XML completed as expected. At the bottom of this message I included a screenshot of my action setup and successful test result. If you would like to send a link to your error, you can reach me at help@catalytic.com.

    I also found a helpful resource online for formatting XML. Included below is a link to the online resource and common XML errors documented on the site.

    https://xmllint.com/

    Common XML Errors & Rules You Need To Know

    • Don't forget the root tag - Remember, XML is like a tree structure and needs a single root element in place.
    • It’s important to note that duplicate attribute names within a tag are not permitted with Xml.
    • XML is NOT HTML. XML does not recognize self-closing tags like HMTL, so be sure to close all tags!
    • Be sure to follow all XML rules. Unsure of the rules? No problem – you can read them here.

  • Jozef_783863
    Jozef_783863 Posts: 331 admin
    Options

    Thank you @SHI_103138, we can continue the new topic via the email you sent.