Checking if an Object is Null
  • 18 Feb 2020
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Checking if an Object is Null

  • Dark
    Light

Article summary

Overview

The Object Is Null component checks whether a given input is "null," or non-existent. Based on its determination, the component returns a "True" outcome if the input is null, or a "False" outcome if the input object(s) exist.
To add the component to a Flow, in the Steps panel, in the category Data, drag an Object is Null component to the workspace.

Example

The example flow will illustrate how the Object Is Null component works by retrieving a folder at random and evaluating its output as either a null or non-null value.

Begin by navigating to a project folder and selecting the Create Flow button. Give the flow a name and select 'OK' to open it in the Flow Designer.

2019-10-09_145003.PNG

To start building the flow, in the Flow Designer's startup window, under the category Integrations > All Integrations > Internal Services > FolderService, select a GetByID component and click Add to add it to the workspace. This component retrieves a folder by its unique ID to be used as input for the Object is Null component.

2019-06-27_1535.png

Next, select the Object Is Null component from the Flow Designer's startup window, under the category All Steps [Catalog] > Data, and select 'Add' to add it to the workspace.

2019-06-27_1536.png

In a production scenario, we'd likely direct the flow to two very different outcomes, depending on which value Object Is Null 1 returns. For the purposes of this example, however, connect both the True and False outcomes to the End step.

2019-06-27_1537.png

To tell the Get By ID 1 step what folder to evaluate, in the Properties panel for the step, select theShow Mapping Editor link to map its inputs. Select Flow Data > FolderID.

2019-06-27_1538.png

This will return no folder data because no folder actually exists.

To set the value it's checking, Object Is Null must have an input mapped. Select Object Is Null double click to Show Mapping Editor to map its inputs.

Inside the Mapping Editor, map GetByID1_Output to value, then select 'Ok' to save the change and return to the Flow Designer.

2019-06-27_1539.png

The flow is complete.

Run it in the debugger, Object Is Null 1 identifies the output GetByID1_Output as a null object and returns a "True" outcome, listed in the Events tab ("outcome: True").

To evaluate an actual folder, an option is to hard code a folder ID. It is possible to retrieve a folder ID in the portal by browsing the folder URL. Mapping this as a constant input value will make the Object Is Null 1 step evaluates False, assuming there are entities within that folder.

2019-11-21_112013.PNG


Was this article helpful?

What's Next