To compose, or not to compose, that is the question
Good morning, afternoon, evening, or night, my fearless automation architects! Is your love for Power Automate as everlasting as that carton of almond milk you swore you'd finish? Well, buckle up, because today we're diving into the fascinating and frequently misunderstood world of the 'Compose' action!
But first, let's pop open the hood and see what the Compose action actually is. Is it a finely crafted symphony, delicately harmonizing your every flow? Eh, not quite, but it's not too far off.
Essentially, Compose allows you to create and manipulate data on the fly within your flow, just like a maestro conducting a melody. Only instead of notes and rhythms, you're handling data inputs, variables, and outputs.
Let's break it down into some casual scenarios:
The Middleman Maneuver
Like a trusted broker in a Wall Street trade, Compose acts as an intermediary in your flow. Let's say you're doing a little bit of data gymnastics between SharePoint and Teams (because, let's face it, who isn't these days?).
You want to grab a file's metadata from SharePoint and send it to Teams. The catch? You want to add a bit of jazz by appending a custom text like "Here's your daily file, hot and fresh!" before the file name. Enter the Compose action.
Here's how:
- Use the 'Get file metadata' action to grab the file info.
- Add a Compose action, and input: `"Here's your daily file, hot and fresh! " & outputs('Get_file_metadata')?['body/DisplayName']`.
- Use the 'Post a message' action in Teams and use the output of the Compose action as the message text.
Voila! You've just orchestrated a SharePoint to Teams relay race with a mid-way costume change. Now that's Power Automate fashion!
The MacGyver Multi-tool
Need to bend, fold, and twist data into impossible shapes? Compose is your Swiss Army knife in Power Automate. Let's say you're working with an array of data, but you want to filter out specific values. Compose is here to help, like a trusty sidekick!
Here's an example:
- Use 'List rows present in a table' (Excel) to grab your data.
- Add a Compose action and use the expression `filter(outputs('List_rows_present_in_a_table')?['body/value'], item()?['Column_Name'] == 'Value_you_want')`.
- Use the output of this Compose in a 'Create HTML table' or any other action that suits your fancy.
Et voila! You've just morphed your data like a shapeshifter. Professor McGonagall would be proud!
The Calculated Conductor
Like the wizarding world's Arithmancy, Compose can do some magical calculations for you. Maybe you need to add the number of tasks you've done this week, and your fingers are too tired to count (we've all been there). Compose can do the heavy lifting!
Here's a short routine:
- Use 'List tasks' (Planner) to gather your tasks.
- Insert a Compose action and use the expression `length(outputs('List_tasks')?['body/value'])`.
- Take the output of the Compose and flaunt it in a beautifully worded email or Teams message.
Abracadabra! You've just turned into a Math Magician!
In summary, the Compose action is the unsung hero of Power Automate. It's the jack-of-all-trades, the multi-tasker, the translator, the go-between, the calculator, the filter, the—you get the point.
So, remember, next time you're staring at your flow, feeling a little stuck or overwhelmed, unleash the power of the Compose action and orchestrate some automation magic! Who knew data could dance to your tune?
Comments
Post a Comment