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

In this guide:

  1. Okta Workflows guides
  2. Extract one key/value from a list of objects
  3. Related Okta Workflows guides
  4. Okta Workflows resources

Okta Workflows guides

Okta Workflows guides are questions and answers from the community office hours, the #okta-workflows channel on MacAdmins Slack, and other places. Read all the other guides.

How to extract one key/value pair from a list of objects in Okta Workflows?

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

Extract one key/value from a list of objects

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.

Okta Workflows resources

πŸ“Ί Learn from Okta Workflows videos.

❓Ask questions during Okta Workflows community office hours.

πŸ›Ÿ Ask questions on the Okta Workflows community forum.

πŸ™‹πŸ»β€β™€οΈ Join the #okta-workflows channel on the MacAdmins Slack to get help from the community.

Leave a comment