← Course Home
Okta Certified Workflows - Specialty · Part II

Create a Report

23% of Part II — the last use case, per the exam's own recommended order.

Create a Report

Task 1: Create a JSON Report

3 tasks · this deck covers task 1 of 3

↑ Create a Report Overview

The Task

"Create a JSON report"

A "report" here is just a JSON object your flow assembles from data it has gathered, then converts to a string so it can be emailed, posted, or written to a file. Two Object/JSON functions do essentially all of the work.

Step 1 — Construct the Object

The Construct function (Object category) "creates an object based on a set of user-defined inputs." You add custom fields where "input names become the key names in the constructed object," and drag in values — text, numbers, booleans, objects, or lists — from earlier cards in the flow.

Nested Reports

For a report with nested sections (e.g. a summary object containing per-type breakdown objects), the docs describe using two Object Construct cards: build the inner object first, then drag it in as a typed field of a second Construct card to build the outer object.

Step 2 — Stringify for Output

Once assembled, the Stringify function (JSON category) "converts a typed value such as an object or a list into a JSON string." Input can be "any JSON type such as a list of objects, a list of text, or just a number," and the output is a single-line string ready for an email body, an HTTP request body, or a file write. Stringify is "the inverse of Parse" — Parse turns a string into an object; Stringify turns an object back into a string.

The Connection — Function Categories

These two functions sit in different categories of the 20 listed under Functions in Workflows: Construct lives under Object, while Parse and Stringify live under JSON. Knowing which category a function is filed under is how you find it fast in the card picker.

The Angle — What Trips People Up

Watch for this in your own sandbox run:

→ Trying to Stringify raw card outputs before Constructing them into a single object first — Stringify serializes whatever typed value you give it, so an unorganized set of loose fields won't produce the report shape you want.

→ For nested reports, forgetting the inner Construct card has to run and produce its object before the outer Construct card can take it as an input.

One Line To Remember

Build the report shape with Object Construct (input names become key names), nest by feeding one Construct card's object into another, then serialize the whole thing with JSON Stringify — the inverse of Parse — to get the final string output.

Sources: help.okta.com/wf — function-reference/object/object_construct.htm; function-reference/json/json_stringify.htm; function-reference/functions.htm