---
title: "Reusable Action Lists and Action Groups"
url: "https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/reusable-action-lists-and-action-groups.md"
canonical: "https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/reusable-action-lists-and-action-groups/"
tags: []
author: "Roy Osherove"
description: "Lesson 10 of 18 in Automating All the Things with FinalBuilder (Flow Control & Error Handling), 5:18. Free video by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Reusable Action Lists and Action Groups

1. [Courses](https://courses.osherove.com/#courses)
2. [Automating All the Things with FinalBuilder](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/)
3. Flow Control & Error Handling

Lesson 10 of 18

Duration: 5:18 [Watch on YouTube](https://www.youtube.com/watch?v=vKEVJ62Qb4M)

## In this lesson

To download several websites without copying actions, Roy Osherove extracts the download action into an action list, a function with a URL string parameter, and calls it with run action list actions for cnn.com and google.com, which he renames with F2 to make them more readable. He wraps the calls in an action group, a hierarchical placeholder for several actions, and notes that action lists let him maintain things in one place and see what the script does rather than how it does it.

## Transcript

754 words

[\[00:02\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=2s) Okay, let's take a look at making things a bit more maintainable and scalable. I want to now get multiple websites, not just CNN. So, I could control Ctrl + C and Ctrl +V multiple times and each time to change the website here and then the website there. But each time I would also have to remember to change the name of the file here, etc. Maybe there's a better way. And the way we're going to look at is called action list or functions. So action list or function. I can right click underneath here and say create or add action list.

[\[00:35\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=35s) But I could also rightclick on this action here and say right click refactor extract actions to new action list. We'll call it download a page. Now in download a page what I'd like to do is I'd like to have two parameters. Right click add or action list parameters. Maybe just one parameter. The parameter would be the URL.

[\[01:07\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=67s) It would be of type string. So you can sorry right click action list parameters. You can see maybe I'll give it a better name PC URL. That way I have a naming convention just for the things that this action list needs. Now I'll double click the action to say okay I'll just download stuff from P URL and you could say maybe I'll I'll just replace the whole thing. I'll just assume it's always HTTP and the HTTP get only works with HTTP.

[\[01:39\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=99s) So we can assume it's always HTTP. If you want HTTPS there are other actions for downloading stuff like that but for now this is good enough for us. And I want to save it for anything called important. And again, the P URL string here. If I now save this, all that's left for me now is to go here and you see I when I refactor, I got a new run action list action.

[\[02:10\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=130s) I can find it here again. Action list. Run action list. And I can double click it. And now I have the list of variables that I can send in. So let's say CNN.com. And let's copy and send that. This time we'll say google.com. Now I can of course sorry I pressed F1 and nobody likes F1.

[\[02:40\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=160s) But I can press F2 and edit this and say this is CNN. F2 here and say this is Google to make things a bit more readable. And now if I actually try to run this, we might get a behavior that looks like oh this is running in parallel or it's running in a weird way. If you if you see that those actions are running after they should have run, you can rightclick again these two actions and say refactor

[\[03:11\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=191s) Wrap with action group. An action group is a group of actions that have to run before you finish. So if you run this now, it's just a placeholder basically. So now if we run this again, you'll see HTTP gets and then only then things run. So an action group is nothing but a placeholder, a hierarchical placeholder for us to capture multiple things. So I can for example rename this and say download web pages

[\[03:42\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=222s) And each one of them calls this function twice which just happens to have a single action in it to download a file but it uses the variables in multiple places to do things. So now I download these places, all these files and I can sorry I can rightclick on favorites. Let's go to FB demo and here I have the new files and I have new file.txt. We should have all the text here from two sites.

[\[04:14\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=254s) This is the Google stuff. This is where CNN ends. You can see that Cena is using clicktail and now we have Google. So now what we've seen is that we can use functions or action lists to reuse a piece of code and call it multiple times to make things a bit more readable and understandable.

[\[04:50\]](https://www.youtube.com/watch?v=vKEVJ62Qb4M&t=290s) And so we'll only have to maintain things in one place. And we there's more to this, but this is a very powerful feature of FinalBuilder. And notice that in terms of readability, I can still figure out what's going on because I can just see the what things do instead of instead of just watching how they do it. So it's very easy for me to parse things and enable or disable them as needed.

## Related

- [Build Pattern: Extract Script](https://osherove.com/blog/2013/1/19/build-pattern-extract-script.html) · osherove.com

    Roy's build pattern for moving a repeated set of actions into one script that takes the differing values as parameters, as this lesson does with an action list and its URL parameter.

- [Build and Continuous Integration - Toolgasm achieved](https://osherove.com/blog/2008/8/12/build-and-continuous-integration-toolgasm-achieved.html) · osherove.com

    A 2008 post with his team's FinalBuilder build tree, where each tab is a small build tree like a function, the action lists of this lesson.

[Previous lesson Making Variable Access Faster with Typing](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/making-variable-access-faster-with-typing/) [Next lesson Global Error Handling](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/global-error-handling/)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
