Working with JSON walkthrough
- Topics:
- Workfront Fusion
CREATED FOR:
- Beginner
- User
Learn how to create and parse JSON within a scenario to support your design needs.
Arrays walkthrough
Workfront recommends watching the exercise walkthrough video before trying to recreate the exercise in your own environment.
In this video, you will learn how to:
- Create and parse JSON within a scenario to support your design needs
Transcript
The purpose of the next walkthrough exercise is to conceptually show you how to utilize information sent into your scenario in a JSON format, parsing it into fields and items that you can map throughout your scenario and then either grabbing information from those mapped arrays or aggregating the information into JSON to then be sent out to another system that expects JSON as a receiving input. To be successful at this walkthrough exercise, you will want to create a new scenario which you can title Working with JSON Donut Data, and within the walkthrough exercise folder, you’ll want to utilize the Donut Data - Sample JSON Word document. This isn’t a file that you need to make a copy of for your own personal use but you can simply get into the file and copy the information within, which we’ll talk about and examine in the first exercise video.
Let’s start by taking a closer look at the sample JSON file titled Donut Data in the walkthrough exercise folder. If I zoom in on this information and recall what we learned in the previous course on working with arrays, you’ll remember that in JSON, an array is identified by the square or box brackets, and a collection is identified by the curly brackets. And finally, each key value pair is going to be identified by a key in quotes separated by a colon and then the value right after. So we can see some simple key value pairs at the beginning of our collection, within our array. And then down below, we have another collection within the collection containing an array of key value pairs: an ID, an ID number, a type, and a value. If I zoom out, I can see that we have one collection here, a second collection here, and on the second page, a third collection within the array. Each collection contains different variable numbers of batter types and topping types. I’m going to click anywhere in this information select Command or Control + A to select all and then Command or Control + C to copy the information which we’ll use in the next video as we begin building our scenario.
Now that we’ve copied this JSON, let’s go into our Fusion System and create a new scenario titled Working with JSON Donut Data. For our trigger module, we’re going to use the set variable module.
For the variable name, we’ll simply say Donut Data. For the variable lifetime, we’ll leave it as one cycle. And for the value, we’ll do a Command or Control + V to paste in all of the JSON we copied. Go ahead and click OK. If you’d like, you can rename this module JSON from another connector.
Now that we’re sending JSON data through our scenario, we’ll want to parse it so that we can use the variable information throughout the rest of the scenario. So I’ll click Add another module and I’ll choose the Parse JSON module.
Then we need to create a data structure for the JSON coming in. Since we already have it copied on our clipboard, we can simply click Add, select the Generator, and paste in that sample data again. Once you click Save, make sure you give your sample data a name such as Donut Data.
Now, our JSON string that we want to pass through our data structure is going to be the set variable from the previous module.
Let’s go ahead and save and run once to see the type of information that will pass through our scenario.
Clicking into the execution inspector on our trigger module we can see that the bundle output data is just a long JSON string. If I go into the execution inspector for our Parse JSON, I can see that we now have a structured list of three bundles of information containing collections and arrays for the batters and the toppings as we expected from examining our JSON Sample Data.
Now that we parse the JSON into items and values that we can map and use throughout our scenario, let’s perform a couple different actions with those items. I’ll start by adding a router after our Parse JSON module.
Once I do that in my first path, I’ll use a set variable module.
For the variable name, I’ll simply type Batter Types By Donut.
And for the value, I know that the batter types are contained within an array so I’m going to go to my array functions and choose the mapping option which we’ve used in other walkthrough exercises. In the first space in the mapping function, I want to put in the array that I’m going to dig into and map to a specific item. After the semicolon, I want to open the batter array and make sure that I use the exact same name as the item from that module type.
This will give me all types of batter per donut or bundle passed into this set variable module. If I click okay and run the scenario one time, we’ll see that three bundles of information were passed into this last module, and that if I look into each one, I can see that the output for the first donut type came as regular, chocolate, blueberry, and devil’s food batter types. The output for the second bundle of information or donut pass through is regular, and the batter types for the third bundle is regular and chocolate. If I only want to look at or use one specific type of batter throughout the rest of my scenario, then I can map to the specific item in the list. To do that, I’ll go back into my set variable module and after mapping to a specific field within the array, I can add another semicolon and say that I want to go in and for each type I only care about pulling information on the chocolate type.
If I click OK and run once again, we can open the execution inspector and see that yet again three bundles were passed through, but the output on the first is just the chocolate batter type. The output on the second is nothing because it did not contain a chocolate batter type. And the output on the third also had chocolate in it.
So the lesson to be learned here is that we can map to a specific field within an array which will result in multiple outputs, but then we can also filter down to a specific item in that array by using the field name or the key name and the value. If we go back to our JSON, we can see that here we have an ID and an ID number as a key value pair, but we also have a type and the name of the batter type as a key value pair. So I can either filter by the ID or I can filter by the type to pull out that specific piece of information from the array.
Now, let’s say that after you’ve parsed the JSON, you’ve manipulated it or changed it in your scenario for whatever uses you had, but then you need to pass it to another system as JSON yet again, what you can do is choose from one of three JSON modules.
If I click into my second path in the JSON app, I can see that there’s a Transform to JSON module, a Create JSON module, and an Aggregate to JSON module. We won’t show all three, but we will choose the Aggregate to JSON since we have three bundles passing through after our Parse JSON module. I click aggregate to JSON. I do need to choose like similar aggregators. Which module is my iterator? In this case, it’s our Parse JSON. And then I do need to define the data structure for the JSON that I want to send out. Of course, you could redefine the data structure and map accordingly, but in this case, I’m going to simply choose our Donut Data data structure from our previous video, and then I have to map each of the values from our Parse JSON to create our new JSON that we’re going to send out. In this case, I’ll simply map everything over just as is but you could of course use the mapping panel in a different data structure to completely change how you’re passing information out of your scenario.
What you’ll notice after mapping over the ID, type, name, and PPU fields from our Parse JSON module that batters and toppings appear a little bit different. They’re not simply a field to map values into. This is because within these fields, batters was actually a collection, and batter is an array. So we actually have to click Add an item and then add the batter ID which is an item or variable in that array, and type as well.
We’ll do the same for topping.
Once we do all of that, we can click OK and run the scenario one time.
Once it runs, we can see by the number on the execution inspector that in the top path we ran through and executed on that module three times. But below, since we’re aggregating all three bundles into one, we only have one operation performed. If I click into that execution inspector I can see the three bundles of information which were all mapped fields from our Parse JSON module. They’ve been turned into a JSON string down below which you could then send off to another third party platform for digestion or use.
Now, of course, this was a conceptual walkthrough exercise of how to parse JSON and use JSON, but hopefully you can see how you can use this universal language between systems to create data structures that you need to use throughout your scenario but then you can send that information on in a usable way by other systems. -
Want to learn more? We recommend the following:
Workfront
- Workfront Tutorials
- Administration and Setup
- Organizational setup
- Manage deleted items
- Configure system defaults
- Layout templates
- What are layout templates?
- Find layout templates
- Customize terminology with layout templates
- Customize the Main Menu with layout templates
- Add and manage pins through a layout template
- Customize Home with layout templates
- Assign and manage access to layout templates
- Customize object areas with a layout template
- Customize project details with layout templates
- Customize project headers with layout templates
- Customize reporting lists with layout templates
- Email and In App Notifications
- Create and manage users
- Approval processes and milestone paths
- System performance and maintenance
- Project finances
- Custom Data
- Custom Forms
- Calculated expressions
- Get started with calculated fields and expressions
- Learn the data expression structure
- Understand Date & Time and Mathematical expressions
- Create ADDDAYS, ADDWEEKDAY, ADDMONTHS, ADDYEARS expressions
- Use the Calculation Editor
- Create DATEDIFF and WEEKDAYDIFF expressions
- Create a SUB, SUM, DIV, or PROD data expression
- Use the CONCAT expression in a calculated field
- Create LEFT/RIGHT expressions
- Use the ISBLANK and CONTAINS expressions
- Create an IF text expression
- Things to know about calculated field expressions
- Manage work
- Projects
- Understand basic project creation
- Navigate the project page
- Learn four ways to create a project
- Fill in the project details
- Get started planning a project
- Take a project live
- Get started managing a project
- Find projects
- Share a project
- Understand the project team
- Understand project communication
- View project information
- Track overall project progress
- Track work progress with project metrics
- Understand the Gantt view
- Understand the Board view
- Tasks
- Issues/requests
- Request queues
- Portfolios
- Approval processes and milestone paths
- Create and manage project templates
- Project timelines
- Close a project
- Project finances for users
- Intermediate projects
- Projects
- Reporting
- Basic reporting
- Understand reporting elements
- Understand reporting components
- Create a basic grouping
- Create a basic view
- Add basic conditional formatting to a view
- Create a basic filter
- Understand the new filter experience
- Create basic filter activities
- Create a simple report
- Create a task report
- Copy a report
- Create reports with charts
- Create a matrix report
- Create dashboards
- Send and share reports
- Understand report settings
- Intermediate reporting
- Create filters with user-based wildcards
- Create filters with date-based wildcards
- Create OR statements in filters
- Understand built-in project filters
- Understand built-in task filters
- Understand built-in issue filters
- Understand basic text mode for filters
- Understand basic text mode for views
- Understand basic text mode for groupings
- Create custom prompts
- Advanced reporting
- Calendar reports
- Basic reporting
- Manage resources
- Workfront Goals
- Workfront Planning
- Integrations
- Adobe Creative Cloud
- Adobe Experience Manager Assets Essentials
- G Suite
- Jira
- Microsoft Outlook
- Microsoft Teams
- Adobe Workfront for Microsoft Teams Overview
- Install Adobe Workfront for Microsoft Teams
- Access Adobe Workfront from Microsoft Teams
- Search for and share Adobe Workfront items in Microsoft Teams
- Create Adobe Workfront tasks from Microsoft Teams
- Submit Adobe Workfront requests from Microsoft Teams
- Manage Adobe Workfront notifications in Microsoft Teams
- Slack
- Fusion
- Welcome to Workfront Fusion
- Understand the basics
- Initial scenario design walkthrough
- Initial scenario design exercise
- Mapping panel and formula editor
- Mapping panel important notes
- Beyond basic mapping walkthrough
- Beyond basic mapping exercise
- Use filters
- Filters walkthrough
- Filters exercise
- Access previous versions walkthrough
- Access previous versions exercise
- Universal connectors and routing
- Universal connectors exercise overview
- Introduction to universal connectors walkthrough
- Introduction to universal connectors exercise
- Understand routers
- Routers walkthrough
- Routers exercise
- Common routing patterns
- Routing patterns walkthrough
- Routing patterns exercise
- Set-it and get-it
- Get/Set variables walkthrough
- Set/Get variables exercise
- Iteration and aggregation
- Execution history and scheduling
- Beyond basic modules
- Data structures and data stores
- Final functional bits and bobs
- Troubleshooting and error handling
- Workfront Fusion administration
- Design optimization and testing
- Workfront Proof
- Learn the benefits of proofing
- Understand the difference between a document and a proof
- Proofing viewers explained
- Administration and setup
- What is an automated workflow template
- Customize proof comment actions
- Customize proof decision options
- Understand email alerts and proof notifications
- Proof roles and email alerts
- Report on proofs
- Set default at risk proof settings
- Set up global proof settings
- Set default proof roles
- Set up proof account default settings
- Settings for proof users
- Upload proofs
- What is a proof version
- Who uploads the proof versions
- Convert a document to a proof
- View and compare proof versions
- Upload a proof version
- Manage proof versions
- Upload a proof of a video
- Upload a proof of a website
- Upload a proof with a basic workflow
- Upload a proof with an automated workflow
- Upload with a drag and drop
- Combine multiple files into a single proof
- Proof workflows
- Review and approve work
- Workfront DAM
- System setup
- Metadata and keywords
- Brand Connect customization
- Workfront DAM user: Contributor
- Understand Workfront DAM as a contributor
- Understand asset management as a contributor
- Understand finding assets as a contributor
- Understand lightboxes as a contributor
- Understand metadata and keyword best practices
- Work with assets as a contributor
- Send a file as a contributor
- Publish assets as a contributor
- Add a Workfront DAM link
- Brand Connect user
- Home
- Agile
- Best Practices
- Agile
- API Explorer
- Business case and portfolio optimizer
- Communication
- Custom forms
- Custom reports
- Dashboards
- Documents
- Filters, views, and groupings
- Job roles
- Layout templates
- Licenses and access levels
- Onboarding and adoption
- Organization units
- Portfolios and programs
- Preview sandbox
- Project, task, and issue preferences
- Project templates
- Proofing
- Request queue
- Resource Planner
- Resource pools
- Scenario Planner
- Schedules
- Statuses
- System performance and maintenance
- Text mode reporting
- Timeline planning and management
- Timesheets and logging time
- Utilization
- Workfront Goals
- Workload Balancer
- Workfront for executives
Get inspired by fellow certified Workfront users
Discover how two Workfront pros grew their skills and advanced their careers through Adobe certification—and how you can too.Read their stories
Learn about Adobe User Groups across Experience Cloud
Master Adobe Experience Cloud solutions along with your peers through Adobe User Groups. Join this event to learn how to get involved!
Connect: Admin Chat for Marketing & Creative
Are you a system admin for a marketing or creative team? This customer-driven session will connect you with other admins to discuss best practices as well as tips and tricks.