Making JSON sing with Workfront Fusion + JSONata

Hosted in partnership with Steve Watts and Brian Haight of Adobe Professional Services, this session walked through the basics of reading JSON path notation, understanding data types, and choosing the right starting path in Fusion.

In addition, three real-world examples were covered from finding and filtering data, to reshaping JSON, and doing advanced transformations on the fly. It’s a must-have skill for any Fusion admin looking to save time and simplify data handling!

Transcript

So welcome to today’s session, making JSON sing with Workfront, Fusion, and JSON-IDA. I am by no means an expert in this space, and so we are lucky to partner with some folks in professional services to help lead today’s session. And so if you are very new to the session, I just want to call out one quick highlight before we go into some housekeeping and an agenda, and that is a huge congratulations to our Adobe Workfront champions. This is the very first class, Workfront Champion Program for 2025, 2026. There’s 37 folks here that will be participating in this, doing some advocacy opportunities. You will likely hear from them, see their names. So just a huge congratulations to those folks who have been accepted. We are excited to work with you, hear what you have to say about Workfront, and help shape the future in partnership with the product team. And so if this is your first customer success workshop, we do record these sessions just so that you guys have access to the recordings afterwards. So we will send a follow-up email this afternoon. We’ll get a link to the slide deck. You’ll get a link to the recording. You’ll get any resources that were shared in the chat. We’ll do our very best to summarize everything that was included in today’s presentation. So keep an eye out from that. It comes from the csatscale at adobe.com email address, which is our team’s email address. I’m not gonna go through my team here, but I’m part of the Scale Customer Success team here at Adobe Workfront with Leslie and Cynthia. But most importantly, I have Steve and Brian here. And so I am going to maybe let Steve, you introduce yourself, since you’ll be leading today’s session. Brian’s gonna be helping to moderate the chat and the Q&A pod. So Steve, the floor is yours.

Hey, thank you so much, Nicole. Can everybody hear me okay? Just double quick, quick mic check. Yeah, sound good. Awesome.

So hi, I’m Steve Watts. I am a senior integration consultant with Adobe Professional Services.

My primary areas of focus are with Workfront Fusion, but then also crossing over into kind of all of many, many of the other components that are across our Adobe Stack. I’ve built integrations with Workfront and Fusion, plus AEM, plus Frame.io, plus AJO. So I have done quite a bit of integration work across the Adobe Tech Stack. I’ve done other integration work with other services for other clients, including Salesforce and ServiceNow and Jira and Azure DevOps and a host of others. This is, I just passed my four-year mark. So I get my five years and my first sabbatical next summer. Woo-hoo.

Glad to be here with you all. I’m excited to share this topic with you all.

We’ll go ahead and, if we’re good, Nicole, am I gonna take over from here? Just go share my screen. Yeah, feel free to. Yeah, excellent. Yeah, floor is yours for the next, you know, 55 minutes. Awesome, appreciate it. And also real quick, Steve, good to see everybody. I’m just a sidekick today. So many of you saw me last time on the other call, the CSV call, and you’re gonna see some familiar faces. So I’m gonna let Steve take the reins. He’s the massive JSON and JSONata expert. So this is gonna be a treat. So yeah, take it away. Yeah, thanks, Brian. I have my name on the slide, but I should recognize Brian. I really appreciate his help and kind of getting this started and then moderating today. And Brian’s a fantastic, fantastic integration consultant in his own right. So I’m glad he’s in my corner today. Okay, so hopefully you can see my screen. So our topic today is making JSON sing with Fusion and JSONata, okay? And I’ve now introduced myself, so we’ll just kind of move on. Come on to the next. Just a real quick break on our agenda. I think the most exciting part is gonna be our three use cases. I’m really excited to walk you guys through some kind of practical use cases, but we’ll kind of start at the beginning, just talk about what JSONata is, some of the resources, both online and some things I’ve prepped specifically for this session.

Couple of things to know, some core background knowledge, and then we’ll go through our use cases in Q&A.

Okay, so who is this session for? This is for Fusion developers who are technically minded and proficient, but maybe you don’t necessarily come from a software development background. If this describes you, you are in the right place. Welcome. If this is not you, welcome regardless. We’re glad to have you here. If you do come with software development background experience, then JSONata will become a, it’s pretty much second nature once you pick up some of the basic syntax. There’s a few minor things that it does because it has to live in various places. But we’re glad to have everybody here.

So JSONata, what is it? So first of all, it’s a pretty cool play on words. Obviously, the term, SANATA, is a musical term. I took piano lessons for eight years. I’ve played many, many Mozart and Beethoven sonatas in my lifetime, the most famous of one being Beethoven’s Moonlight Sonata. Okay, everybody knows that one.

What is it? It’s a programming library that’s designed to be used for JavaScript-based programs, and this includes Fusion. Most of Fusion’s kind of core development layer, the actual kind of interface for creating your scenarios, is really based in JavaScript. It’s a single-page application based in JavaScript and Node.js.

So it adds a bunch of functionality that lets us interact and exchange and manipulate JSON data in ways that we couldn’t do before it was introduced into Fusion earlier this year. So at the time, when they first introduced it, they made a big deal out of it. They were like, hey, this new cool JSON, a lot of things there, and I kind of went, eh, I don’t even care about that. Then once I kind of got into it and realized what its power and capabilities were, this is actually a pretty cool, exciting introduction to our Fusion environment. It’s a very, very popular package. I checked there. They’re based just on their Git page. It gets downloaded about 600, it’s included in various packages, so that’s like they just grab it from the Node package manager. It’s getting included about 600,000 package inclusions a week off their GitHub, so it’s a very, very popular package. So again, if you’re a Fusion developer, why do you care? Well, just, I mean, us Fusion folks, we’re just messing around with JSON data everywhere we look, everywhere we turn. And for a long, long time, when we would get big batches of JSON data, there were certain limitations in terms of being able to, okay, how do I dig into this big batch of JSON data and how do I filter stuff out? And oh man, I’ve got to create these big, long iterator to do filtering and reaggregation and recombining stuff, and then I’ve got to do it again because I’ve got to go down another level, and oh my gosh, I don’t know, maybe I don’t even know how many levels of data I have to traverse. How am I supposed to find all this? JSONata is just the magic pill, the secret bullet that’s going to help us here. We can radically transform what we do directly with JSONata, so let’s get into the weeds with this. Okay, so first couple of resources. We are going to be doing some kind of line, excuse me, sorry, I lost my train of thought for a split second. There are some online resources, and we are going to do some kind of live hands-on using the JSONata Exerciser, so feel free to jump there.

And some of the samples that I’ve included, hopefully this link was shared with you. If not, we can hurry and put that in the chat if you want to. Let me go back, let me go back. That just points to a little, my personal OneDrive folder, and all the resources are stored there. I don’t know if, Brian, if you can grab that link and just share that real quick. I think I shared it with you, yeah. So we put that in the chat. So that includes some of our resources that we’re going to use today. Was that the zip file that you had shared? Because I had put it in the reminder email, but if there’s more, then we can always include this one as well. Yeah, this just kind of includes everything.

So it just includes every, so there’s the zip file, but then everything, all the individual files separately, and the slide deck are all just kind of there. I tried to make it a public folder link for the entire Adobe organization, so you should just be able to sign into your Microsoft SharePoint, and then just access that link directly. But if not, we’ll figure it out, and we’ll come back to it. But yeah, we want to have you be live and hands-on with some of those resources as we go. Okay, moving on. Oh, wait, real quick, Steve. I don’t think I have that link, but just try to get it out of your emails if you can. Oh, you want me to grab it? If possible, or you can put that in the chat if you like. Also, I just want to say real quick, these two links, the Core Library documentation, the Realtime Exerciser, are massively helpful.

And you can actually go to the documentation, grab the examples, and sometimes just paste them right into the right side of that exerciser. So if you completely fall asleep during Steve’s presentation today, please go through the documentation and go through the exercises and play around with it. It’s really fun. It’s great, great examples in there. Thanks, Steve, for putting that in. You betcha. Okay, cool.

It’s formatted a little weird because it came right out of my deck, but other than the font size, it should work. Okay, so going on back. Thanks, Brian. Thanks for your help with that. Okay, so before we dive into the actual JSONata kind of library itself, what are some things that you should kind of hopefully have some background in? I mean, honestly, it’s very, very helpful. We’re working with JSON. It’s pretty darn helpful to understand a little bit about what the actual JSON data format is and how it works. How do I access basic data inside? How do I traverse kind of a basic JSON object tree using both like the standard dot notation. The dot notation, as you can see, it’s where it’s, you know, I have an item one dot, you know, sub level two dot sub level three, which we’re all pretty familiar with. In some cases, you do also may need to use the bracket notation, which is very similar, but it serves a different purpose because there are cases where you may not be able to use the dot notation for various formatting or other kind of programmatic reasons. I don’t want to dive into the details there, but one example would be, hey, I’ve got this really long data key and it doesn’t really fit. I can’t use dot notation because it doesn’t really work programmatically. Or, okay, one thing to be careful with, the bracket notation is used for different things inside JSONata, so sometimes you just have to watch and be careful if you’re going to try to use like a, I need to do a filter using a bracket notation. It’s specifically used in JSONata in various places, which you’ll see here. So sometimes you have to be careful where you use those specific filter types.

Last but not least, if those, in some cases, you may not be able to use either of those. You may then also want to use kind of the, called the template literal syntax. This is used occasionally where instead of using like the bracket notation, you wrap things in backticks. This is pretty common in Fusion for us Fusion developers. I think we’ve seen that.

But that’s the most common, those are the most common. So just be aware of those kind of basic JSON notations. Obviously, you got to understand your basic JSON, how data is represented in JSON, if it’s a string, a number, an object, key value, arrays, simple arrays, and object arrays. Understand your array reference notations. This one, obviously, anytime you want to find, hey, find the first item in an array, it’s basically indexed by array number. Be careful, programmatically, JavaScript generally sets the first array item as array item zero. That’s pretty common across programming languages. Fusions often start them at one. That’s kind of a thing that I actually wish Fusion didn’t do. It’s trying to be helpful because they’re trying to help us non-programmers say, well, nothing starts at zero. Everything should start at one. But programmatically, it often will start at zero, and that’s what JSONata does.

JSONata does not care about your line and space and break formatting.

Those of us that are JavaScript developers know this is both a blessing and a curse at times.

But literally, this statement and this statement are identical just with different spacings. They will both equally parse and work just fine.

All right, moving on.

Okay, so the first couple of things that I would recommend that you study in the actual JSONata documentation, and we’re going to focus a little bit on these up front before we dive into our use cases.

So the first big one, I mean, these four are absolutely, probably the four biggest things you should study up front. And if you’re having trouble understanding each of them, that’d be to go back and say, okay, there’s clearly some dependency knowledge that I need to really understand the processing model. Maybe I should go back and just review what is the JSON data format really look like, or maybe there’s some principle that I need to understand. But those are the four things we’re going to talk about a little bit now. So let’s first go into the processing model.

So the deck does include a direct link directly to this. So your JSONata has a series of processing sequences that it will go through. Some of them are optional. These three are pretty much required across kind of any expressions or things that you develop. The first thing is you’re always going to provide a mapping process or sequence up front. That’s always the first thing that’s included. And this just basically looks at the data that you provide. It, you say, here’s my JSON data. Okay, I’m going to now create a map or tell me where to go inside this data before I start running whatever it is I’m going to do. It will almost always include a filter process. And then this last process is the reduce process. The filter process is technically optional. Like it doesn’t, you don’t have to use it, but it’s very, very, very common. I mean, most of the cases we’re going to want to use it for will use filtering of some kind. The reduction process is also basically could be considered like a, this is like your data output, or it’s not technically like a remap, but it is just a, hey, take everything you found from my mapping and filtering and tell me how you want to then display it. If we don’t apply like a reduce process to it, it will just spit back to us exactly the way it looks inside our data as it is. Sometimes that’s fine. Sometimes we actually want to change the way that data comes back to us. And so we would apply that as a reduce process. You can kind of see how it builds across. You start by just defining that where you are on your data map. You potentially apply a filter sequence to it, and then you apply your output or reduction, your reduced sequence at the end. So take a look at that.

One of the interesting things about JSONata is you can, because it’s kind of a, it does, can be used as a kind of almost a pure functional programming language, is you can actually embed functions and expressions within kind of any area of the processing model as long as you appropriately encapsulate it. Typically that means JSONata uses the, just a basic parentheses, which is different than some programming languages, but in JSONata, if you see a pair of parentheses, as I note there in the bottom bullet point, that indicates that that itself is being treated as its own expression or function output. So you can embed those kind of anywhere inside the JSONata as you build it. We’re not gonna get that fancy today with maybe one exception, but just, it is kind of an interesting thing that you can do, and one of the reasons it’s really powerful.

We talked about that reduce process. We can create our own custom data output. So meaning when we send some data in, if we don’t like the way it’s formatted in our input, that’s where we can use that map reduce process at the end to create our own. Like we can create our own custom JavaScript. Okay, I actually want it to look like this is the key and these are the values I’m gonna insert with that key and I’m gonna totally make it look the way I want it to. And you can theoretically ignore, like you can completely ignore whatever is in the input entirely and just remap it yourself.

What you get back, as I alluded to earlier, will really depend on what goes in. By default, if we don’t supply a reduction process, it will just give me back exactly what is in that section of the data. So if I’ve got a big block and it’s just a big array of objects, that’s how it’s gonna get sent back to me. Okay, this part of the data is that thing. I’m just gonna give it back to you exactly the way I see it. And so it’s very important then to just understand what are the data types that you should expect to get back. By far the most common is we’re gonna use our own. We’re gonna create our own output, our own reduction expression. Say, hey, I want the data to look like this when I’m done. If not, usually in Fusion, most of the time we’re gonna often get back a little JSON array of objects. Sometimes we’ll get just like a simple array of just items, you know, like just an array of items. And very, very rarely will we ever get back just like a single item, but occasionally, you know, that’s what happens.

In your reduction mapping, we are gonna kind of alluded to this already, because you can insert expressions anywhere inside the processing model.

We can use variables from anything inside your data. So if this is our source, item one, item two, this is our little JSON block. If there’s like a sub-item called data key and data key, we can completely define both the key and value pairings for our process mapping at the end, our reduction mapping at the end. This will make more sense as we go along, but just be aware that that’s a pretty cool output feature.

Okay, so first off, so the first part of the process then is we just need to get into our data and find a starting point, get a map, you know, get a placeholder of what piece of the data that we’re inputting are we actually gonna look at, okay? So this is what I call just finding the path.

Again, use our dot notation, and this is right from their documents. It’s gonna just look at and say, okay, wherever you go inside your data using your dot notation, it’s gonna say that this right-hand point or the end point of the map, and it’s gonna look at the context of each item. So if I go to a point and there’s an array of six objects, it’s just gonna say, okay, this is the array of six objects that I care about for this particular operation.

There’s a couple of things you can do if you need to change or remember where you are inside your data. There are maps or placeholder variables that can be used. These are maybe more advanced concepts down the line as you get a little more experience with it, but the biggest one is always that, our little dollar sign. This is similar if you’ve ever used just basic JSON path structures. That little dollar sign, you’d usually put at the top and it just indicates kind of like, this is the top level and everything, and then the top level object is, just start there. I’m not gonna define it explicitly, and then we’ll move down from there. In Fusion, that would often be our output body data. So that little dollar sign, the symbol there just represents that, our top level. The other thing that’s also interesting though is that that symbol can also be used in context of generating output, which is just take everything that’s here. So for example, I wanted to say, okay, we got to a certain point. I know there’s a specific data key inside my JSON, not just for the start of the path, but for my output, for my reduce.

Go to that point and then just give me everything that’s there. So it’s also, it’s used on both sides. It’s a little bit interesting. It’s fairly intuitive once you kind of get used to it, but hopefully not too out of the norm.

There’s a couple more. If you’re ever, some points you’re maybe inside a block of data and realize, oh, so I’ve got one block of data I want to take from this space, but there’s actually something, I want to go back up one level and get some other piece of data. This is a little placeholder symbol that you could insert into a function that says, okay, I’m going to do a thing where I am now. But then for the next section, go back up one level and then start doing another kind of transformation op expression from that point. Then you can also do like, this is kind of the similar as just going up one level, but this is like an explicit, the context variable binding. It just says, hey, this specific point in my data, I’m going to create a permanent reference to it that I can come back to kind of anywhere throughout, the rest of my data operations. If I want to go back to that very explicit point in my data, hey, I’m just going to declare that as a variable name and that it becomes kind of that context specific binding. So Steve, did you do that? You need the at sign and the dollar sign there? Correct, correct, exactly like that. Yeah, and that’s in the documentation. They kind of go over that pretty explicitly, but yeah, that’s exactly as outlined there.

So, oops, let me go back. I’m moving ahead. Okay, so then connecting this back to Fusion, I already alluded to this just a minute ago, but again, the idea is in Fusion, what we do need to kind of then, okay, I need to know where I’m starting from when I push in like a data set. Usually it comes out of a module, like a search module of some kind, and it’s a big old JSON data block. When I insert that into the JSON model and module in Fusion, I need to be aware of where am I starting from? So if I insert it from the body object, then that means the top level of my data point is body, and I need to start my kind of first mapping expression the data object, right? So I insert body, I’m now starting from data, and that’s where it starts. Or maybe I want to go one additional level down. Maybe I want to go down from body into data. So now body, data, well now I’m one further level down, and so I need to adjust my JSONata expression accordingly depending on where I do the insertion in Fusion. This will make more sense in a second when you see it in the use case, but that’s just one of the key things. If you’re having, one of the things that takes a bit of adjustment is if you’re having issues getting your JSONata module to work inside Fusion, it may be because, oh, I’ve just started myself too high or too low inside my data output. Maybe I need to go in and fix which data start point I’m pointing to when I insert the data into JSONata. So it’s just kind of a helpful key for troubleshooting. And then Steve, if you’re troubleshooting this, is it better to go use the JSON tools online there to go troubleshoot if you’re trying to get the expression right? That’s a really interesting question, Brian.

Maybe let’s look at that in just a minute because sometimes, yeah, sometimes you can’t necessarily simulate what Fusion gives you directly using the, just by taking like the raw output from a Fusion module and sticking it into the, the JSONata exerciser. And we’ll see why in a second. So you kind of have to just be, it just takes kind of general awareness of that kind of across the board, but you’ll see what I mean here in just a second when we look at it.

Okay.

Okay.

So we can pause there. I can see there’s one question. When should we choose JSONata over JSON? That’s a good question. I don’t know that it’s really a choice of one or the other. The reason to use JSONata inside your Fusion scenarios is just that the flexibility that it gives you and the power that it gives you in ways that Fusion just didn’t have until it existed, you know, starting March in this year.

It’s just a way to take JSON data and use it in ways that we just couldn’t. It’s not really a replacement for JavaScript unless you’re going to create your own, yeah, unless you were going to create maybe some of your own custom input output expressions, or you had some, you were going to pass data to, you’ve got to, maybe you or a client has a scripting service and they’ve got their own code that’s going to take your data and transform it for you. Or, you know, in this case for Fusion, it’s just very, very useful to kind of just do some of that really powerfully. It’s kind of hard to explain. Hopefully you’ll see some of that as we go a little farther, but. Yeah, very powerful for parsing stuff and parsing stuff in a new structure that you want to create a new structure, a new way to look at your JSON that’s coming out in another valid JSON format. The main JSON modules in Fusion are very, very useful for creating JSON because you have the data structure that you can specify exactly what this thing looks like. You can use that generator, very, very helpful. JSONata is super helpful with parsing things in a very specific way and make things more user-friendly.

Yeah, then another question just quickly says, can we use an iterator module with JSONata to iterate over things? Yeah, although in some ways the JSONata module acts as its own iterator in a sense. Like if you give it a big block of data, it naturally assumes that you want to iterate over kind of everything that you specify. And so that’s one of the cool things that I like about it is it kind of reduces the need to kind of do some of those post-mapping iterations and re-aggregations because the JSONata module itself just handles it for us naturally and the data output that I get back can be restructured. But yes, in some cases you might want to. You say, well, I’ve got this thing that I’ve reformatted from JSONata, but yeah, now I do need to iterate over the output in a new way and that’s very common too. It’s kind of a combination of both, but I do really like JSONata for that reason that it does help. It is kind of its own self iteration. It’s a self iterator, this kind of internal to it, which is pretty cool.

Steve, we’ll answer more of the questions at the end. Okay, cool. Yeah, we’ll go ahead.

Okay, so our first basic use case is a pretty simple one. That’s a pretty common one that we do in Workfront all the time, which is, hey, I searched for something, but there’s like a bunch of child objects that I pulled in with it. And I want to actually now filter down the stuff that I pulled in that are child objects without having to do multiple queries and then iterate over my second query data set and then filter and map it. So one of the most common ones I always use is if I’ve got a project with a group of documents, I often want to just say, okay, I’m going to query the project, I’m going to get the big documents array all at once. And now I don’t have to do any secondary iteration or filtering or reaggregation. I’m just going to use my JSONata module to quickly pull out exactly the documents I want based on their file extension and which folder they’re in. It’s pretty slick. Okay, so in this case, this is where we can go into our first sort of training exercise if you’re following along using the exerciser. So in this case, I’ve already inserted this body, which is, this is the body from the scenario. So if you’re in Fusion, this is using the global development platform. I have a project that’s got a set of about seven or eight documents inside of it. And so I’m just using it. So what I’m doing is I’ve run this query and I’ve just taken the little output and taken that into the JSONata exerciser. If you have those exercise files, that’s just the set dataset one, the text file. So it’s just the dataset one, the document output text. And Steve, if you’re planning to log on home, you need a project with some documents on it, right? You got to plug in the project ID in there. You do, yeah, in the Fusion scenario. So again, I’ve given you the plumbing, but you’ll need to add a few bits and bobs. Yeah, correct. So this is the MyData output. And I can see there’s an array of documents. There’s, like I say, you can see there’s about six or seven, documents of various types inside my output. And so the goal here now is, again, I just want to vary, without having to do any additional, like, Fusion stuff, I’m just going to run that stuff into JSONata and then quickly apply a filter to it.

So this just, again, going back, so remember our core three main processes where we have our mapping, we have our filtering, and then we have our reduction or, you know, kind of output reduction, okay? Our filter from the syntax.

So in this case, this is actually, Brian, where it gets interesting. So you see here I’ve got star.data.documents. Well, this goes back to that same issue that I alluded to a second ago of, well, if I’m taking this output exactly as it is here, I actually have to start at body.data.documents, just like that, okay? So then it shows me that there’s that, it’s just now pulling out that array of documents, you know, outside of kind of its upstream data points. Now, in Fusion, though, this is interesting because in Fusion, when we get that data output, it doesn’t let me start from that point. I have to specify, I either have to start from the body or I have to start from the body data. It does not let me start from the top level like this basic one does. So let me let this run and we’ll see it here in a second.

Hopefully it doesn’t take an hour.

If it takes an hour, you can go in the history if you want and look at it. That’s true, I can, right? There you go.

Okay, so in here, so if you look at it, to actually get that, I can’t start above that. So I have to start from the body, okay? So this goes back to what we talked about a minute ago, which is, well, how do I know if I’m using the output, how would I set it up to use the exerciser to simulate what I’m doing inside Fusion? So in this case, in Fusion, I have to start from the body. So if I actually want to simulate this in the exerciser, I actually have to eliminate body. I have to figure out how to correctly represent this to my exerciser in the same way that I’m gonna see it in Fusion. And so I’ve gotta come in, I’m gonna do a quick, so I’m gonna take it out of that array wrap, and then I need to take out the body, which is gonna be way down at the bottom, which ends here. So that’s the end of the data. I gotta erase everything else that’s not body.

Let’s see, oh, do I have an extra? I have an extra, there you go. Okay, so just like that. So that’s why it’s sometimes a little bit tricky, is that getting the data into the exerciser in the same way that Fusion is gonna see it may take a little bit of manipulation like that. So now I’ve cut out the body, so now, because I’m now representing it the way Fusion’s gonna see it, now that matches what we have in my deck. Star.data.documents, that’s my initial map. That’s where I wanna start from. Okay, that was a bit unintuitive, but hopefully it makes sense in context. I had to realign this so that I could make it work exactly the same way it’s gonna work in Fusion. I have to take that body component out. But Steve, would you say that’s a general rule to take that body out if you’re trying to use this exerciser? It, yeah, that’s gonna be by far, that’s probably your best bet, is just take that body object key out, and that’ll be the best way to simulate what you’ll get out of Fusion. Nice, cool. Yep, cool. So then the next step was just to then apply our filter. And so that, if you look at, if you have the homework at home, so this is just gonna, we’re just gonna pull that out of my notepad here. All right, so that just matches there. Star.data.documents, and for the first one, I’m just gonna filter, just find me all the PDFs that are in my review folder. We’re just gonna apply that filter, go back to our exerciser.

Oh, I have no match. Okay, so that’s interesting. I should have a match.

Give me just a second. I thought I had completely planned this out, Brian. Give me just a second. Well, when I did this, I didn’t have any documents in the review folder, so it didn’t work until I did that. Ah, okay.

Yeah, let’s go back here.

You can see in his query there, he’s looking for the folder.name equals review. There’s no other way to do this in such a way in, without several modules to kind of figure this out. Yeah, I should have my folders. It’s really nice.

Yeah. I should have a folders. Well, you can run it in, just run the Fusion example if you like.

Oh, yeah, okay. It definitely works in Fusion. In the Fusion example.

So you can see there.

So there was one. So in that current item, yep, there it is. Current version equals PDF, and my folder is in the name review. It’s okay, yep, there’s the one set. There’s a set of documents. There it is. I have exactly one document that meets that criteria. So that’s just a nice, simple way. And this is really, really cool for doing, again, nested object searches or nested object compilations in Workfront. Again, like if you’ve got projects in a group of tasks, but you then want to filter out the group of tasks without having to do like a separate task query, and then an iteration over that task set and filtering operations or mapping operations, just throw that data set into your JSONata and apply your filter expression just like we did there. Current folder. For example, your filtering on the document name is very tricky. So this is a great example. I mean the folder names, the filtering on the folder name. Yep, so that’s a nice, simple one. Okay, so that’s our first little exercise. So our second one, just a tiny bit different.

We’re gonna change our filter. We’re gonna find everything that’s a JPEG, but then we’re gonna just, we’re gonna add a reduce or a kind of a realignment of what we want the output to be. So let’s go back into our exerciser. We’re gonna use the exact same data set.

We’re just gonna change.

We’re gonna change our filter so that we’re looking for anything that’s a JPEG. And there we do have some that are JPEGs there. So that’s pretty nice. And then the next step is, rather than getting it back as this array, right? So in Fusion, if we change that real quick.

So we’re just gonna change our filter here in Fusion to match. Let’s change that to JPEG.

Then run it.

So when it comes back, it’s still just, it’s like an array. It’s got an items. If I need to, like, as a user, I need to visually map them or see what they are or get some indication as if I’m working with these downstream. That’s not really as easy as I would like it to be. So now I’m gonna use my reduce output or reduce process to change what this looks like when it comes back. So we’ll see what that looks like here.

When you define your reduce kind of component of your process, what you’re really, oh, go back. I forgot I can’t click on that without it moving forward. I’m like, oh, I should, I can like highlight that and stuff. Nope, can’t do it. What you’re actually going to do is you’re just going to say, so remember, your map, your filter, and then immediately following, you’re just gonna create a little JSON expression. So this is, again, goes back to understanding, okay, if I wanna create my own JSON data, what should it look like? So go ahead and we’ll just kind of pop that in. And again, if you’re following along at home, this is your data expression number two. So it just adds, we’re just gonna add that full little output item there. And I’m gonna realign it in our exerciser.

So we’re just gonna attach that to it. And voila, now I’ve changed it from like this blank array where I can’t see what it is, to now I can actually see the actual asset name when I get my output from JSON. Same thing in Fusion. Let’s just include our output, our little reduce expression.

Run it again.

And now once again, instead of getting a blank array, I’m like, oh, sweet, I can actually see the asset names. I could do more than just the asset name. It could be asset name and some reference number or whatever it is, just something. But now I can use this much, much easier downstream than having to hunt and peck and try to sort through it all. So that’s kind of just what that little reduce operation helps you with. It just lets you realign the data output in a way that you can see it and use it more easily downstream.

Well, the next one takes that even just a step further. And this is kind of one of the cool advanced features, which is, so you saw what we did before as we hunted down into our documents, then it just kind of gave us back that document set. Well, let’s say that we actually get a big data block from some data source. But we want to keep most of it the same because there’s a lot of things we want to keep it exactly like it is, but there are pieces of it that are not usable. We would really love to change or realign them. But inside the context of what’s already there, I don’t want to delete the stuff that’s there because there’s still useful stuff, but there’s certain pieces of it I want to realign.

We’re going to do an advanced transformation in place.

The most common concept for us in Fusion developers, if you’re working with Workfront, is often with the Workfront planning data output sets. Even if you use the output aliased directive, it doesn’t always give you a nice human readable view of what you’re looking at. So enter JSONata’s transform operator. This is kind of a, it’s basically a function format. It doesn’t look like a true function for those of you programmers. Like it doesn’t accept, like it doesn’t have a function with the parameters, but it follows a similar setup. There’s a very specific syntax that’ll help us do this, and you’ll see here in just a second.

One of the things to keep in mind, and that third point there, is that sometimes when you’re doing some of these data transformations, you don’t want to try to do it all at once. If you’ve got big long nested blocks of JSON, sometimes it’s easiest to just do it in chunks. Start with, find one, the innermost set, and work your way back up to the top, which is what we’re going to do here for our planning. We’re going to recast planning.

So this is from the document.

It’s not necessarily as intuitive as it could be in the documentation, but basically what it’s going to do, you’re going to say, okay, so the head is basically our original map. So it’s going to say, go to a certain place in our JSON. Then from there, indicate the next downstream location that you think needs updating, and then update the stuff inside of it, and that’s how we’ll return it back to you. So what does that really look like? So in this case, this is if we were doing this in for a planning object, you can see what I’m doing. So I’m going to map from the top level, go to the fields area, and then once I’m inside fields, I want you to remap all of the options inside of it, casting them by their name rather than ID. And then you could, again, going back to, you know, I alluded to earlier, that little dollar sign can be used in multiple ways. That’s the same thing here. I’m basically saying, go into the name object, and just pull back everything associated with it. Okay, so it’s both kind of a placeholder and a, like a contextual, just grab everything that’s there. So again, that’s one of those sort of just, it gets a little more intuitive as you go, but you might wonder why I’m using the dollar sign in more than one place.

Okay, so we’re going to do this in basically four steps.

So this is where, again, it gets a little tricky, but this is one of the cool things. So you can see what we’re going to do. Oh, I should go back and explain too. Anytime you’re going to do a multiple step operation, you typically do have to wrap it in parentheses like this, because that indicates to Jason and Nada that we’re not just doing like a single output line, but there’s actually gonna be like multiple steps, and each one of these steps is going to be part of a complex formula or a complex expression. And so typically for that, you always just wrap it in parentheses like that to indicate that this is my output expression. Okay, so again, so starting with this, so if we wanted to go into our exerciser, how does this work? Let’s go into our exerciser here. So we’re going to replace both of these. We’re done with you. We’ve got a brand new data set. And in this case, I’m not actually gonna take out the body because there’s so much data there. I’m not gonna try to mess with that. So we’re just gonna start from the top of our record.

And Steve, this is by the way, in the downloaded files, right? You’ll find this is the planning data set on the left area.

Correct, correct.

Also, this is a good opportunity to show what we’re looking at in the planning data and why it’s hard to work with briefly.

Yes, right, okay, so thanks for reminding me. So those of you that are used to this, when you want to look inside planning and understand what it is, typically speaking, when you search for a record, the data output is entirely kind of completely opaque. It doesn’t really give you what anything is. You have to drill down into each item line by line, field by field, and go, oh, okay, that particular item is for this field and this is the object that it represents. And so you spend so much time just trying to hunt through the various things just to kind of find the right mapping or field value or whatever it is. So for example, if this is all the object types, there’s 12 different object types.

There’s a lot of them are. So is that the right one? No, that’s campaigns. I don’t know what that one is. Is that the one I want? Oh, no, that’s programs. So you’ve got to go through every single one. And then if you go into the fields, like, oh my gosh, which fields on that object am I actually looking for? Now I’ve got to loop through each of those one by one. Okay, so what we’re going to do is we’re going to make your lives infinitely easier working with planning data using our JSONata. And this is also a good example. We’re not just picking up planning. A lot of APIs will return data sets that are difficult to work with. And so JSONata is fantastic in trying to restructure those. So it’s easy to work with in Fusion.

Okay, so again, since I didn’t take out this particular, this mapping of that output data, I’m having to account for some changes in my formula. Don’t be alarmed again. Okay, so the one of the things that’s interesting about what I’m doing here is we’re doing this in stages. So going back to our first stage, this first stage is I’m going to recast, kind of I’m going to go as far down as I need to. I’m going down to the innermost level that I want to transform first. And then I’m going to iteratively move up until I get to the top level and then bring it all back the way that I want. So what we’re going to first going to do, I’m going to start by saying, okay, I don’t want those fields to come back as an empty array. Show me the field name of what it is. And if one of those fields is a linked field name, the field that’s linked from another object, because Plaid’s what we do in planning, right? We link fields from other objects. So that’s kind of the goal behind this. Now, the one thing that’s slightly different about what I’m doing is I’m setting this up. I’m going to, because I’m running this in sequential operations, I’m going to set this first one as a variable. So whatever I get back from this first operation, I’m saving that as a variable because I’m going to use it in my next step in subsequent stages or my next subsequent step. The other thing that’s unusual about this here is again, remember when I said that you can combine different expressions in different parts of the operation. What I’m actually doing is I’ve set this up as its own, whoops, I keep forgetting, I can’t click. I’ve set this up as its own unique sort of encapsulated expression at the end. But guess what? I’m actually going to just redefine my own little data block upfront. So I’m actually saying, I’m actually kind of doing the map reduce or the reduce portion right at the beginning. It’s kind of an interesting thing, but it’ll work just fine because, so again, remember I’ll format a little transform, so take me to a place, go down one level, and then inside that level, here’s the thing I want you to change. Right, so it kind of all goes back there. Going back to that basic formula. Find the place, go to the next level down inside that place, and from that point, there’s something inside of here that I want to remap, right? So top, middle placeholder, what I want to remap. So that’s kind of the formula we’re going by. Well, what does that look like in our exercise real quick? So you can see, so what it did is it came back and said, oh, okay, so yeah, it recast it as a data block, which is what I wanted. But now look what’s happened inside the field. Let’s find a field that has options real quick.

There you go. So now notice all of my field options are no longer just blind arrays. I actually can see the name. That’s the name of the option, the planned option, active, completed, on hold.

And in some cases, maybe I want both, I want two different representations of it, and I want them to be included here. Oh, excuse me, sorry, I’m getting ahead of myself. That’s the next step, okay? So that was my first step. All I’m doing, I’m saying, okay, I want to just change the options so I can see them by name, and then the linked display name, but we are not done by far. So the next step here, step two.

So now we’re going to do our next step. So we’re going to take everything from S1, okay? So now we’re going to redeclare a new variable. We’re going to do a new expression to check. I’m going to put everything back into a data block, so okay, take everything I got from S0, start from the data block, let’s go back into the fields, and now let’s update. We’re going to add a uniquely new view to display the options, not just by name value, but by display name value, right? So let’s go ahead, we’re going to add that. Whoops, go back, add that as the second line of our formula.

And our exerciser here, go to the end of the line, and you say, okay, well what did that do? Let’s go back in and look.

So in addition to updating our options values, I’ve now added an options name that’s different. So I can either do it by name or display name, and now I have two different references to those same object values. This is often very useful for custom dropdown fields in planning, because the values are often still just like an index name, like a UUID, which you still can’t identify, so we’re going to make it very, very easy. We can either look at either the name or the display name in our output. Okay, we’re running out of time. I’ve got to get through this real, real quick. I want to still have time for questions.

Okay, now that we’ve done that, we’ve recast the options and the options by display name as well, now we’re going to add our third line, which is now let’s display the fields by name. Sorry, let me get to the right thing here. So we’re just going to add one more item to our ever-growing expression.

So now we say, so now for, so sequence zero, sequence one, sequence two. For sequence two, we’re going to take, we got back from sequence one, we’re going to drop into our data block, and we’re going to recast our fields by display name. And now let’s watch what happens when that happens.

Okay, so now you can see the fields are now no longer just a blank ID or an empty array shell. I can now see the fields have their names. I can see what it actually is. Oh my gosh, that’s the campaign overview field, hooray. Okay, last but not least, then once we’ve got the field options, the fields now set by name, now I’m going to go back and just set the actual objects. So the actual record types I want to also see by name. So we’re then just going to take that and we’re going to come back, take our S2, go into our data. So this last point, we’re not using that little transfer, that in-place transformation, we’re just going to do our own little, a new little output. We’re going to take the data, set it to use its own display name and just return everything exactly as I have it. And then magically, there it is. There’s my campaign. That’s the name of the object type, campaign. There’s the field names. Now, what does that look like in Fusion? Let’s take a look.

So as we saw before, that initial planning output was pretty opaque.

Soon as we get this to run here, we’ll see how much easier this will be for us to use going forward.

Once again, the Fusion would kindly cooperate in a timely fashion. Oh, you forgot the magic word, Steve. It’s a live demo. What could possibly go wrong? It’s your fault.

So true. Why do I expect things to go well, Brian? Why do I make that mistake so, so often? Let’s just go back and take a look. Let’s see. Oh, no, that’s not the right one.

I don’t want to see now. It’s still going. Good grief.

Let’s go back to planning, go back to JSON. Okay, so here’s our better view. So when it’s done, what I get back is this beautiful, beautiful output where I can now immediately see there’s the record type.

Here’s the fields. There’s each of the fields’ names. And if that field has options, there’s options by UUID, and there’s the options by name. And I can use any of those as reference points at any point downstream in my code. So lots of massive help. Thank you, Jason Nada, for helping us that are going to be working with planning.

Just this little formula is just an absolute lifesaver. All right, so we’ve got four minutes left. That kind of concludes the last bit of the demo.

That’s kind of what we got through. I can say there’s our final result. We just validated. There it is. There’s our fields, partners, and name, which we just demonstrated there. All right, I’ll stop sharing questions with the last four minutes. Brian, what do we have? Well, there was one question about AI. You recommended AI for helping to create Jason Nada scripts. Which one would you recommend? And we do that, and we need to get an answer. But I’m curious if you’d get an answer.

That’s a good question.

Which one have I been using? I’m a VS Code guy, and so I think GPT-4 is its default. Maybe in consensus. It seems to do okay. I haven’t tried the Clod 3, Clod 3.5 to kind of see if it gets any better.

The GPT-4 seems to be, yeah, it’s never, yeah. I think James Ritter has a comment in the chat. He says, yeah, GPT-4 works okay, but it always needs some review and refinement. It never gives you exactly necessarily but I’ve found it’ll get you typically about- Yeah, it gets you like 90% of the way. 80%, yeah, 85% of the way there. Yeah, just out of the gate.

Especially for like a hard calculation that you need to, or a hard formula that you haven’t done before. It’s a good way to get that first step.

Correct.

Another question about Workfront reports and if we could get an export in JSON format, which would be great. But there’s a good answer back there, which is you can actually use the Workfront get call. You can actually use it right in your browser. And especially if you add a little API key to it. So if you do gets with a search module and then do your filters, what I like to do is go create a report, do a filter and a report in Workfront, switch the filter to text mode, and you could nine out of 10 times copy the filter stuff right into your URL, a little ampersand, and you can get the same filter in there. It’s a nice trick if you want to try it. And you might need an API key on there too. Correct, yeah. And this is actually something I, there was a developer that I literally, I’m gonna, this was not in the agenda, but I literally just stole this from a developer like a couple of days ago. Cause they had done this for me. They actually created a JSON function expression to turn CSV into mapped JSON. And I was like, oh, that could be really helpful. So this is one of those things that you can, if you’re doing that. So this is only CSV to JSON, as in go JSON to CSV, that’s kind of a different thing. But this is very, very helpful if you have, and I tested this out thoroughly and I don’t know exactly which developer did it. I’m fairly certain they probably used an AI helper to kind of get started. Cause it’s a pretty, I mean, those regular expressions are pretty gnarly. Like that is a crazy regular expression, like these regular expression tests that it’s doing on these match expressions and these replace expressions. But hey, it was super cool. I was like, hey man, somebody did all the hard work for me. I’m telling you, I’m gonna steal that right out of the gate. So that’s another kind of useful thing. I can add that into the OneDrive link and you guys can get into there. Hopefully when we get everybody added. So that’ll be, I’ll turn that, turn the CSV into JSON formula we’ll share as well. Love it. I think we’re out of time. I think we’re out of time.

Nicole, anything to add? I think we’re good.

No, honestly, nothing to add. I’m just gonna call out one thing because that was honestly so impressive. You’ve made it seem so easy. And for someone who’s nothing about code, I felt like I might have a chance to do something like this. So thanks for kind of putting it into words and giving us some step-by-step instructions. This was fabulous. But most importantly, I just wanted to just call out some of the upcoming and on-demand Fusion sessions. I know people have asked. So Brian had done a session last month on data imports with Workforce Fusion. There’s also a handful of other on-demand sessions from Fusion on the Experiencia community. But also there’s gonna be two Fusion events happening next month, scaling with advanced features in Fusion part two. So if you were part of that, wake up with Workfront session that was done earlier this year, this is gonna be sort of a tackle onto that. And then Mayo Clinic will also be sharing how they’re using Fusion in mid-October. So just wanted to call those out before everyone wraps up. You guys will get a link to a survey if you didn’t get a chance to fill it out. I really encourage you. It’s totally anonymous. I’ll share all the comments and feedback with Steve and Brian but most importantly, I really just wanna say thank you both for stepping in today, share your expertise, being so thoughtful and detailed and answering all the questions that came in. I hope that this was super valuable for everyone here in attendance. Really just giving everyone a headstart and ideas for how to kind of expand their Fusion use cases. So really appreciate your time and effort.

Thanks so much for having us. Hopefully this is helpful. I’ll make sure we try to get all the material available to everyone. So just thank you for your attendance and appreciate your questions.

And yeah, and Brian, thanks again to you for helping moderate and help drive this. So thanks again, everyone. Great to see you. Thanks guys, have a great day.

If you weren’t able to attend live, no worries - review the slide deck and watch the on-demand recording to follow along.

Check out the Experience League Community post for a downloadable, follow along zip file of training materials!

New events are added every month, so make sure to check out the Experience League Events page for the latest sessions.

recommendation-more-help
6edade56-d2ab-4a9c-aa51-c4621d6137a0