Fixed values in Compose instead of variables
Quiz question
Where does an email address go that never changes during the flow?
Solution
- A) In a variable, so the flow runs fasterWrong. A variable does not make the flow faster. Variables in parallel loops give unpredictable results. If you use variables, the loop has to run sequentially.
- B) In a Compose action or in Parse JSONCorrect. Fixed values need no variable. Compose or Parse JSON make it clear that the value does not change.
- C) In a separate Condition at the start of the flowWrong. A Condition checks something and branches. It is not meant for storing a fixed value.
What it is about
Many flows start with a row of Initialize variable actions for values that never change: an email address, a list URL, a threshold. Fixed values do not need a variable. A single value goes into a Compose action. Several related values go into Parse JSON as one JSON object, and you read them with an expression like body('Parse_JSON')?['settingName']. The flow gets shorter, and everyone sees right away that these values are fixed. Variables in parallel loops give unpredictable results. If you use variables, the loop has to run sequentially. Set Apply to each: Concurrency control, Degree of parallelism 1. Keep variables for values that really change during the run, such as a running total.
When to use it, when not
Use it
For settings that stay the same during the run: addresses, URLs, thresholds, texts.
Better not
For values that change during the run, such as a total or an array you fill step by step. That is what variables are for.
Most common mistake
Marking fields as required in the Parse JSON schema that are sometimes missing. The run then fails on schema validation.
License
Standard This technique uses standard connectors. Microsoft 365 usage rights cover standard connectors. Check the rights for your whole flow. Source on Microsoft Learn: Power Automate licensing FAQ. For your whole flow: License check.
Share
Short link: powerautomate.ninja/en/5
Source: PowerPlatformTip #5, Microsoft Learn: Use data operations in Power Automate.
Prefer to continue with guidance? The Power Automate live course (in German) at the Power Platform Academy runs over four weeks. The next dates are not set yet, you can join the waiting list on the course page.