- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello, I'm looking for help in creating a flow . I'm trying to create a catalog item with a flow in flow designer that will create a program then attach an already created group then create sprints for that group in servicenow without scripts. I would also like to create subflows to allow the team to use them in other flows.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can do this using Flow Designer without scripting by splitting the logic into subflows and then calling them from your main catalog flow.
First, create a subflow that creates the Program record and returns its sys id.
Then create another subflow to link the existing group to that program using the appropriate relationship.
After that, create a subflow to generate sprints where you loop based on the number of sprints and create sprint records linked to the same program and group.
In your main flow triggered from the catalog item, just call these subflows one after another and pass the data between them using data pills. This way, everything stays reusable and clean for future use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Try these
Catalog Item → Main Flow (Service Catalog trigger) → calls 3 Subflows:
- Create Program
- Attach Group to Program
- Create Sprints
Step 1: Catalog Item Variables
Create a catalog item (e.g., "Request New Agile Program") with these variables:
- program_name (Single Line Text) — Name for the new program
- program_description (Multi Line Text) — Optional description
- agile_group (Reference to
rm_agile_grouporsys_user_group) — Lookup to pick the existing group - number_of_sprints (Integer) — How many sprints to create
- sprint_duration_days (Integer, default 14) — Length of each sprint
- start_date (Date) — When the first sprint should begin
Step 2: Subflow 1 — "Create Program"
This subflow is reusable anywhere a team needs to programmatically create a program.
Inputs:
program_name(String)program_description(String)
Actions:
- Create Record on table
rm_program- Set
short_description→ drag inprogram_nameinput - Set
description→ drag inprogram_descriptioninput - Set any other default fields (state, assignment group, etc.)
- Set
Outputs:
program_record(Reference to the created record) — use the output of the Create Record action (Program Record)program_sys_id(String) — sys_id of the created program
Step 3: Subflow 2 — "Attach Group to Program"
This handles the many-to-many relationship between programs and groups.
Inputs:
program_sys_id(String)group_sys_id(String)
Actions:
-
Create Record on the M2M association table. Depending on your instance version, this is typically
m2m_rm_program_rm_agile_groupor similar. To find the correct table:- Go to an existing program → Groups related list → right-click the header → "Show XML" or check the relationship table name.
Set fields:
rm_program→ drag inprogram_sys_idrm_agile_group→ drag ingroup_sys_id
-
Alternatively, if there's a direct reference field on the group record pointing to a program, you can use Update Record on
rm_agile_groupwhere sys_id =group_sys_id, setting the program field.
Outputs:
association_record(Reference)
Step 4: Subflow 3 — "Create Sprints"
This is the most complex subflow — it loops to create multiple sprints with sequential dates.
Inputs:
group_sys_id(String)number_of_sprints(Integer)sprint_duration_days(Integer)start_date(Date/Time)
Actions:
-
For Each (Flow Logic) — this is key. However, since Flow Designer's native "For Each" requires a list, you'll need to build a counter pattern:
Option A — Use a "1 to N" loop pattern:
-
Use "Repeat" flow logic (available in newer versions). Set the repeat count to
number_of_sprints. -
Inside the loop, for each iteration:
a. Create Record on
rm_sprint:short_description→ Use an inline concatenation:Sprint+ loop index (you can use the loop item's index pill)group→group_sys_idstart_date→ Calculated:start_date+ (loop_index×sprint_duration_days)end_date→ Calculated:start_date+ ((loop_index+ 1) ×sprint_duration_days)state→ Default (e.g., "Planning" or "Not Started")
Option B — If "Repeat" isn't available, use a workaround:
- Before calling this subflow, create a helper subflow that uses "Look Up Records" on a utility table with known row counts, limited to
number_of_sprints, then pass that list to a "For Each" to iterate.
-
-
Date Calculations Without Scripts:
- Flow Designer has Date/Time pills and transforms. When you drag in a date pill, you can use the "Add Duration" transform to add days.
- For each iteration:
start_datepill → Transform → Add Duration →sprint_duration_days× iteration index
Outputs:
sprints_created(Integer) — count of sprints created
Step 5: Main Flow — "Provision Agile Program"
Trigger: Service Catalog
Actions (in order):
-
Call Subflow: "Create Program"
program_name→Trigger - Catalog Item → Variables → program_nameprogram_description→Trigger → Variables → program_description
-
Call Subflow: "Attach Group to Program"
program_sys_id→ Output from Step 1 (program_sys_id)group_sys_id→Trigger → Variables → agile_group(sys_id)
-
Call Subflow: "Create Sprints"
group_sys_id→Trigger → Variables → agile_groupnumber_of_sprints→Trigger → Variables → number_of_sprintssprint_duration_days→Trigger → Variables → sprint_duration_daysstart_date→Trigger → Variables → start_date
-
Update Catalog Task / RITM — set state to closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can do this using Flow Designer without scripting by splitting the logic into subflows and then calling them from your main catalog flow.
First, create a subflow that creates the Program record and returns its sys id.
Then create another subflow to link the existing group to that program using the appropriate relationship.
After that, create a subflow to generate sprints where you loop based on the number of sprints and create sprint records linked to the same program and group.
In your main flow triggered from the catalog item, just call these subflows one after another and pass the data between them using data pills. This way, everything stays reusable and clean for future use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you so much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Try these
Catalog Item → Main Flow (Service Catalog trigger) → calls 3 Subflows:
- Create Program
- Attach Group to Program
- Create Sprints
Step 1: Catalog Item Variables
Create a catalog item (e.g., "Request New Agile Program") with these variables:
- program_name (Single Line Text) — Name for the new program
- program_description (Multi Line Text) — Optional description
- agile_group (Reference to
rm_agile_grouporsys_user_group) — Lookup to pick the existing group - number_of_sprints (Integer) — How many sprints to create
- sprint_duration_days (Integer, default 14) — Length of each sprint
- start_date (Date) — When the first sprint should begin
Step 2: Subflow 1 — "Create Program"
This subflow is reusable anywhere a team needs to programmatically create a program.
Inputs:
program_name(String)program_description(String)
Actions:
- Create Record on table
rm_program- Set
short_description→ drag inprogram_nameinput - Set
description→ drag inprogram_descriptioninput - Set any other default fields (state, assignment group, etc.)
- Set
Outputs:
program_record(Reference to the created record) — use the output of the Create Record action (Program Record)program_sys_id(String) — sys_id of the created program
Step 3: Subflow 2 — "Attach Group to Program"
This handles the many-to-many relationship between programs and groups.
Inputs:
program_sys_id(String)group_sys_id(String)
Actions:
-
Create Record on the M2M association table. Depending on your instance version, this is typically
m2m_rm_program_rm_agile_groupor similar. To find the correct table:- Go to an existing program → Groups related list → right-click the header → "Show XML" or check the relationship table name.
Set fields:
rm_program→ drag inprogram_sys_idrm_agile_group→ drag ingroup_sys_id
-
Alternatively, if there's a direct reference field on the group record pointing to a program, you can use Update Record on
rm_agile_groupwhere sys_id =group_sys_id, setting the program field.
Outputs:
association_record(Reference)
Step 4: Subflow 3 — "Create Sprints"
This is the most complex subflow — it loops to create multiple sprints with sequential dates.
Inputs:
group_sys_id(String)number_of_sprints(Integer)sprint_duration_days(Integer)start_date(Date/Time)
Actions:
-
For Each (Flow Logic) — this is key. However, since Flow Designer's native "For Each" requires a list, you'll need to build a counter pattern:
Option A — Use a "1 to N" loop pattern:
-
Use "Repeat" flow logic (available in newer versions). Set the repeat count to
number_of_sprints. -
Inside the loop, for each iteration:
a. Create Record on
rm_sprint:short_description→ Use an inline concatenation:Sprint+ loop index (you can use the loop item's index pill)group→group_sys_idstart_date→ Calculated:start_date+ (loop_index×sprint_duration_days)end_date→ Calculated:start_date+ ((loop_index+ 1) ×sprint_duration_days)state→ Default (e.g., "Planning" or "Not Started")
Option B — If "Repeat" isn't available, use a workaround:
- Before calling this subflow, create a helper subflow that uses "Look Up Records" on a utility table with known row counts, limited to
number_of_sprints, then pass that list to a "For Each" to iterate.
-
-
Date Calculations Without Scripts:
- Flow Designer has Date/Time pills and transforms. When you drag in a date pill, you can use the "Add Duration" transform to add days.
- For each iteration:
start_datepill → Transform → Add Duration →sprint_duration_days× iteration index
Outputs:
sprints_created(Integer) — count of sprints created
Step 5: Main Flow — "Provision Agile Program"
Trigger: Service Catalog
Actions (in order):
-
Call Subflow: "Create Program"
program_name→Trigger - Catalog Item → Variables → program_nameprogram_description→Trigger → Variables → program_description
-
Call Subflow: "Attach Group to Program"
program_sys_id→ Output from Step 1 (program_sys_id)group_sys_id→Trigger → Variables → agile_group(sys_id)
-
Call Subflow: "Create Sprints"
group_sys_id→Trigger → Variables → agile_groupnumber_of_sprints→Trigger → Variables → number_of_sprintssprint_duration_days→Trigger → Variables → sprint_duration_daysstart_date→Trigger → Variables → start_date
-
Update Catalog Task / RITM — set state to closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you so much, this was very helpful.
