<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Extract One Key/Value Pair from a List of Objects in Workflows
Okta Classic Engine
Okta Identity Engine
Workflows

OVERVIEW

This KB article will teach you how to extract one key/value pair from a list of objects in Okta Workflows.

SOLUTION

You used Okta’s /api/v1/users/ID/factors API endpoint to retrieve the MFA factor list for a user. You need to retrieve the phone number from the SMS factor.

 


MFA factors.

The following flow extracts the phone number.

 


Flow to extract one factor type.

The flow has the following steps:

 

  1. Get the current user ID using the Okta – Read User card.
  2. Set up the URL to retrieve the user’s MFA factors.
  3. Make a call to retrieve the user’s MFA factors.
  4. The List – Find card finds the first item in a list that meets a specified condition. The card receives a list of objects. It finds the object where factorType is equal to sms. The card’s output retrieves the phoneNumber field from the object (instead of using the Object – Get card).

You can pass the phoneNumber to another card:

 


Connecting the phone number to other cards.

When running the flow, the Find card receives four objects (four factors):

 

MFA factors.

And returns the object the factorType is sms:

 


The List – Find card returns one object.

RELATED REFERENCES

 

 

Loading
Extract One Key/Value Pair from a List of Objects in Workflows