{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4042,"path":"build-workflows/workflow-studio/create-custom-flow-object.md","title":"Create a custom flow to generate an object for each record in a list","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a custom flow to generate an object for each record in a list\n\nGenerate an object for each User record in a list. Learn how to use flow logic to iterate through a list of records.\n\n## Before you begin\n\n-   Role required: admin\n-   [Create a custom action to generate an object from a record](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/create-custom-action-object.md)\n\n## About this task\n\nUse this example to see demonstrations of these operations and steps.\n\n-   Create a flow that runs on a daily schedule.\n-   Look up User records filtered by the Department provided as an input.\n-   Add flow logic that runs for each User record you looked up previously.\n-   Create a contact object for each User record using the custom action you created previously.\n-   Create a log message for each User record.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Process Automation** &gt; **Flow Designer**.\n\n    The system displays the Workflow Studio landing page.\n\n2.  Select **New** &gt; **Flow**\n\n    The system displays the Flow Properties dialog.\n\n3.  Enter these sample values.\n\n    |Field|Value|\n    |-----|-----|\n    |Name|Create Contact Objects From Users|\n    |Application|My Application|\n    |Run As|User who initiates session|\n\n4.  Select **Submit**.\n\n    The system displays the Workflow Studio interface.\n\n5.  Select **Click to add a Trigger** &gt; **Date** &gt; **Daily**.\n\n6.  Select **Done** to close the trigger.\n\n7.  Select **Click to add an Action, Flow Logic, or Subflow** &gt; **Action** &gt; **ServiceNow Core** &gt; **Look Up Records**.\n\n    The system adds the action to the flow.\n\n8.  For **Table**, select **User \\[sys\\_user\\]**.\n\n9.  For **Conditions**, add these values.\n\n    -   **\\[Department\\]\\[is\\]\\[Development\\] \\[AND\\]**\n    -   **\\[Email\\]\\[is not empty\\]**\n10. Configure these field values.\n\n    |Field|Value|\n    |-----|-----|\n    |Order by|Name|\n    |Sort|a to z|\n    |Max Results|1000|\n\n11. Select **Done** to close the action.\n\n12. Select **Click to add an Action, Flow Logic, or Subflow** &gt; **Flow Logic** &gt; **For Each**.\n\n    The system adds the flow logic to the flow.\n\n13. For **Items**, select **\\[1-&gt;User Records\\]**.\n\n    **Note:** You can select the Action 1 **User Records** data pill from the data panel or from the Data Pill Picker button.\n\n14. Select **Done** to close the flow logic.\n\n15. Select the plus icon to add a child item to the For Each flow logic.\n\n16. Select **Action** &gt; **My Application** &gt; **Create Contact Object**.\n\n17. For **userRecord \\[User\\]**, select **\\[2-&gt;User Record\\]**.\n\n    **Note:** You can select the Action 2 **User Record** data pill from the data panel or from the Data Pill Picker button.\n\n18. Select **Done** to close the flow logic action.\n\n19. Select the plus icon to add a child item to the For Each flow logic.\n\n20. Select **Action** &gt; **ServiceNow Core** &gt; **Log**.\n\n21. For **Message**, select **\\[2.1-&gt;contact\\]**.\n\n    **Note:** You can select the Action 2.1 **contact** data pill from the data panel or from the Data Pill Picker button.\n\n22. Select **Done** to close the flow logic action.\n\n23. Select **Save**.\n\n\n**Parent Topic:**[Complex data](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/complex-data.md)\n\n"}}