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
- Role required: admin
- Create a custom action to generate an object from a record
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
-
Navigate to All > Process Automation > Flow Designer.
The system displays the Workflow Studio landing page.
-
Select New > Flow
The system displays the Flow Properties dialog.
-
Enter these sample values.
Field Value Name Create Contact Objects From Users Application My Application Run As User who initiates session -
Select Submit.
The system displays the Workflow Studio interface.
-
Select Click to add a Trigger > Date > Daily.
-
Select Done to close the trigger.
-
Select Click to add an Action, Flow Logic, or Subflow > Action > ServiceNow Core > Look Up Records.
The system adds the action to the flow.
-
For Table, select User [sys_user].
-
For Conditions, add these values.
- [Department][is][Development] [AND]
- [Email][is not empty]
-
Configure these field values.
Field Value Order by Name Sort a to z Max Results 1000 -
Select Done to close the action.
-
Select Click to add an Action, Flow Logic, or Subflow > Flow Logic > For Each.
The system adds the flow logic to the flow.
-
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.
-
Select Done to close the flow logic.
-
Select the plus icon to add a child item to the For Each flow logic.
-
Select Action > My Application > Create Contact Object.
-
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.
-
Select Done to close the flow logic action.
-
Select the plus icon to add a child item to the For Each flow logic.
-
Select Action > ServiceNow Core > Log.
-
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.
-
Select Done to close the flow logic action.
-
Select Save.
Parent Topic:Complex data
---
title: Create a custom flow to generate an object for each record in a list
description: Generate an object for each User record in a list. Learn how to use flow logic to iterate through a list of records.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/build-workflows/workflow-studio/create-custom-flow-object.html
release: brazil
product: Workflow Studio
classification: workflow-studio
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 2
breadcrumb: [Complex data, Build actions, Flows, subflows, and actions, Workflow Studio, Build workflows]
---
# 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
- Role required: admin
- [Create a custom action to generate an object from a record](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/build-workflows/workflow-studio/create-custom-action-object.md)
## 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.
|Field|Value|
|-----|-----|
|Name|Create Contact Objects From Users|
|Application|My Application|
|Run As|User 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\]**
10. Configure these field values.
|Field|Value|
|-----|-----|
|Order by|Name|
|Sort|a to z|
|Max Results|1000|
11. Select **Done** to close the action.
12. Select **Click to add an Action, Flow Logic, or Subflow** > **Flow Logic** > **For Each**.
The system adds the flow logic to the flow.
13. 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.
14. Select **Done** to close the flow logic.
15. Select the plus icon to add a child item to the For Each flow logic.
16. Select **Action** > **My Application** > **Create Contact Object**.
17. 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.
18. Select **Done** to close the flow logic action.
19. Select the plus icon to add a child item to the For Each flow logic.
20. Select **Action** > **ServiceNow Core** > **Log**.
21. 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.
22. Select **Done** to close the flow logic action.
23. Select **Save**.
**Parent Topic:**[Complex data](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/build-workflows/workflow-studio/complex-data.md)
| title | Create a custom flow to generate an object for each record in a list |
| description | Generate an object for each User record in a list. Learn how to use flow logic to iterate through a list of records. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/build-workflows/workflow-studio/create-custom-flow-object.html |
| release | brazil |
| product | Workflow Studio |
| classification | workflow-studio |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 2 |
| breadcrumb | Complex dataBuild actionsFlowssubflowsand actionsWorkflow StudioBuild workflows |