That’s exactly what the example I posted does.
I assume by “GUI” you mean the Automation Editor in visual mode. Yes, you can create what you want using the Automation Editor. However, posting a series of screenshots, showing each step of the process of creating an automation in visual mode, is not the usual way community members share their automations. Reference: FAQ guideline 16
Every automation you create with the Automation Editor in visual mode is ultimately stored as YAML. You can switch the Automation Editor from visual to YAML mode at any time to see the automation in YAML form (click the ‘three-dots’ icon in the upper right-hand corner of the Automation Editor and select ‘Edit in YAML’). It also makes it very easy to share an automation because you can simple copy-paste the example I posted directly into an new, empty automation in the Automation Editor, while it is in YAML mode, then switch it to visual mode.