Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Create a custom flow to generate an object for each record in a list

Generate an object for each User record in a list. Learn how to use flow logic to iterate through a list of records.

Before you begin

About this task

Use this example to see demonstrations of these operations and steps.

  • Create a flow that runs on a daily schedule.
  • Look up User records filtered by the Department provided as an input.
  • Add flow logic that runs for each User record you looked up previously.
  • Create a contact object for each User record using the custom action you created previously.
  • Create a log message for each User record.

Procedure

  1. Navigate to All > Process Automation > Flow Designer.

    The system displays the Workflow Studio landing page.

  2. Select New > Flow

    The system displays the Flow Properties dialog.

  3. Enter these sample values.

    FieldValue
    NameCreate Contact Objects From Users
    ApplicationMy Application
    Run AsUser who initiates session
  4. Select Submit.

    The system displays the Workflow Studio interface.

  5. Select Click to add a Trigger > Date > Daily.

  6. Select Done to close the trigger.

  7. Select Click to add an Action, Flow Logic, or Subflow > Action > ServiceNow Core > Look Up Records.

    The system adds the action to the flow.

  8. For Table, select User [sys_user].

  9. For Conditions, add these values.

    • [Department][is][Development] [AND]
    • [Email][is not empty]
    • Configure these field values.
    FieldValue
    Order byName
    Sorta to z
    Max Results1000
  10. Select Done to close the action.

  11. Select Click to add an Action, Flow Logic, or Subflow > Flow Logic > For Each.

    The system adds the flow logic to the flow.

  12. For Items, select [1->User Records].

    Note: You can select the Action 1 User Records data pill from the data panel or from the Data Pill Picker button.

  13. Select Done to close the flow logic.

  14. Select the plus icon to add a child item to the For Each flow logic.

  15. Select Action > My Application > Create Contact Object.

  16. For userRecord [User], select [2->User Record].

    Note: You can select the Action 2 User Record data pill from the data panel or from the Data Pill Picker button.

  17. Select Done to close the flow logic action.

  18. Select the plus icon to add a child item to the For Each flow logic.

  19. Select Action > ServiceNow Core > Log.

  20. For Message, select [2.1->contact].

    Note: You can select the Action 2.1 contact data pill from the data panel or from the Data Pill Picker button.

  21. Select Done to close the flow logic action.

  22. Select Save.

Parent Topic:Complex data