Diagram

Share this post
Nesting actions
blog.diagram.com
Automator

Nesting actions

Learn more about actions

Jordan Singer
Jan 16
Share this post
Nesting actions
blog.diagram.com

Similar to the layers panel in Figma, actions can be nested inside of one another.

Simply drag an action inside another to nest.

Try nesting a rectangle inside of a frame by adding the “Create rectangle” action and dragging it inside of the “Create frame” action.

Nested actions will appear inset underneath their parent actions.


An example nested action

The “Repeat” action is a great example of an action that relies on nesting.

Whatever is nested inside of it will repeat a specified number of times.

Try recreating the example above that repeats creating a frame with a rectangle inside of it 5 times.


When to nest

Let’s say we want to create a frame and add a fill color.

Left (incorrect): “Create frame” and “Add fill” are running entirely independent of one another. “Add fill” needs to be nested to know what layer to set a fill on.

Right (correct): “Add fill” is being executed on the result of the “Create frame” action.


Here’s an example where we’re fetching a URL from an API and creating a frame with the result as text inside of it.

Left (incorrect): “Fetch URL,” “Create frame,” and “Create text” are running entirely independent of one another. This will create a frame and an undefined text layer separate from one another.

Right (correct): “Fetch URL” runs the actions inside of it once the request is completed. Only then does it create a frame with the result as text inside of it.


Diagram
What are actions?
Actions in Automator are things you can do in Figma by mouse, keyboard, or menu. Piece them together to automate workflows for you and your team. For example, the automation above turns your currently selected text layers into stickies in FigJam…
Read more
5 months ago · Jordan Singer
Share this post
Nesting actions
blog.diagram.com
TopNewCommunity

No posts

Ready for more?

© 2022 Diagram Technologies, Inc
Privacy ∙ Terms ∙ Collection notice
Publish on Substack Get the app
Substack is the home for great writing