Forcelandia 2019 XML & JSON Conference Talk Resources
31 Jul 2019
Table of Contents
Slides (PDF), links, etc. from my “Forcelandia” Salesforce community conference talk
XML & JSON For Total Beginners
Slides
Click Here to download a PDF of the slides
Shameless Plug
I’m speaking about Apex-Defined Data Types for Flow Variables at 7AM PDT / 10AM EDT in a live webinar as a guest of Apex Hours on Saturday, August 3, 2019.
- I toured the technology for admins in June (YouTube here); this webinar will have more code on the screen, but not too much for an eager “admineloper” to follow.
To get the link and a reminder to tune into the livestream, RSVP here.
(The Zoom link might actually be right on that page by the time you see this message. It wasn’t when I wrote this page.)If you can’t make it live, stay tuned to Apex Hours on YouTube to catch up!
Recap
- XML & JSON are just punctuation standards for typing data as plain text. They’re not programming languages.
- Both standards have enough complexity to the allowed punctuation to enable you to type up complicated “shapes” of data like “lists of lists.”
- Because they allow data can be so complex, they’re often the data standard of choice for “fancy” configuration-file and data transfer in cloud environments like Salesforce, Pardot, & MarketingCloud.
- (The cloud also loves them because line breaks aren’t a part of either standard, and line breaks don’t reliably transmit from your computer to a cloud computer or vice-versa.)
Links
- My “zero to hero” tutorial on actually reading and writing XML and JSON, broken into 7 “read on the bus”-size chunks
- Background: XML and JSON are often used to transmit data to/from services in the cloud over “HTTP APIs”, so…
- Downloading & Uploading Salesforce Metadata XML with VSCode – a tutorial (this is “learning recommendation #1” for admins!)
- My Stories: Here are a few ways I’ve reconfigured software I use by editing the contents of the XML or JSON files they depend upon:
- Duplicating Salesforce flow parts, without code, by downloading “metadata” XML, hand-editing it, and uploading it again
- Keeping DemandTools deduplication “scenarios” synchronized with each other, by hand, by copying and pasting XML from one file to another on my computer
- A “DIY Data Loader” I built for Pardot, with code, that downloaded my data as JSON, edited it, and re-uploaded it to Pardot
- Beautifiers:
- For XML, if the contents aren’t a secret – try “Beautify” & “Tree Viewer”
- For XML, when you have secret/corporate data: Try Notepad++ text editor with “Tidy2” plugin for “beautifying” alongside native View -> “Fold All” + Collapse/Uncollapse (or sidebar +’s and -‘s) functionality for “tree viewing”.
Click Plugins -> Tidy2 -> Edit Config 1 and changeinput-xml: no
toinput-xml: yes
before first use.
Click Plugins -> Tidy2 -> Tidy (Config 1) to “beautify” an XML document (spread it out on multiple lines and auto-indent it) - For JSON, if the contents aren’t a secret – try “Beautify” & “Tree Viewer”
- For JSON, when you have secret/corporate data: Try Notepad++ text editor with “JSTool” plugin for “beautifying” alongside native View -> “Fold All” + Collapse/Uncollapse (or sidebar +’s and -‘s) functionality for “tree viewing”.
Click Plugins -> JSTool -> JSFormat to “beautify” an JSON document (spread it out on multiple lines and auto-indent it)
- Documentation: Salesforce’s official “Metadata API” documentation
- Warning: Sometimes this documentation labels a component of “what Salesforce metadata looks like” one thing (e.g. “FlowVariable”) but it’ll appear in actual XML files you download from Salesforce under a slightly different name (e.g. “
<Variable>
“).
- Warning: Sometimes this documentation labels a component of “what Salesforce metadata looks like” one thing (e.g. “FlowVariable”) but it’ll appear in actual XML files you download from Salesforce under a slightly different name (e.g. “
- Documentation: How Pardot’s official HTTP API expects you to transmit data to/from Pardot
- Documentation: The MarketingCloud API instruction manual. Godspeed. 😬
Abstract
If you’ve used the Salesforce Data Loader, you’ve used CSV files. You know … spreadsheets so simple you can open them with a text editor instead of Excel. Not everything in your Salesforce org is spreadsheet-shaped. Like your org’s setup. You can download, edit, and upload text files representing your org’s configuration too — but these files are very different from the CSVs you’re used to.
Demystify the XML and JSON file formats: learn to read them at a glance and how they’re used to solve problems in Salesforce, Pardot, and MarketingCloud. Even if you never write them, a bit of familiarity can make you a better solutions architect and give you a peek into your devs’ world for better collaboration and faster brainstorming. Now that’s admineloping!