cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Community Champion
Community Champion

Compose or use variable?

I am relatively new to Flow, can anyone clarify when one should use variables or when instead one should use Compose?
I am paricularly confused about Compose, not sure what it is and how it is different from a variable.

Many thanks!

 

PS I think @v-micsh-msft@MikeInCairns or @ArtSys may be interested

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Compose or use variable?

Hi @Meneghino,

 

Compose should be able to handle any kind of data Input.

Besides, I don't think Compose is similar to Collect() function.

I will try to explain from my own understanding.

Compare the whole Flow to math equation, then Compose Action should be considered as operators like +, -, *, /,

I think you have noticed that under Compose action in running details, there is only Outputs available,

Through the Compose Action, we could only get the result from the value input, but we can't change the Input, which means there is no way to modify the original input of the same compose,

 

For Variables, it should be the X parameter in the equation, which we could substitute with values,

Under the the running details, you should also noticed that it only contains Inputs, and it has the corresponding action to "Update" the X (original input) value.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Compose or use variable?

Hi @v-micsh-msft

Thank you for following up.  In any case I have now found this documentation:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-actions-triggers#compose-actio...

It is not too clear, but also gives some indications.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Compose or use variable?

Hi @Meneghino,

 

It is recommended to take a look at the Flow blog:

Build more advanced flows than ever

Which explains how the compose is supposed to use:

"

If you have a single value that you want to re-use many different times throughout your flow (for example, a single message that you want to reuse in several emails you send out), you can now compose a string variable:

"

Basically a Compose Variable is only available to use as a container, Variables action has its corresponding action to update itself.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Champion
Community Champion

Re: Compose or use variable?

Thanks @v-micsh-msft

 

I am still however a bit confused.  There is no Compose action in here:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

Is there any documentation on Compose?

 

Does compose only contain a string or can it contain other types?

 

Also, it seems that Compose is almost like Collect() in PowerApps, in that it collects additional strings, as in the example in this blog post:

https://flow.microsoft.com/en-us/blog/email-digest-date-manipulations/

 

Is this so?

Highlighted
Community Support
Community Support

Re: Compose or use variable?

Hi @Meneghino,

 

Compose should be able to handle any kind of data Input.

Besides, I don't think Compose is similar to Collect() function.

I will try to explain from my own understanding.

Compare the whole Flow to math equation, then Compose Action should be considered as operators like +, -, *, /,

I think you have noticed that under Compose action in running details, there is only Outputs available,

Through the Compose Action, we could only get the result from the value input, but we can't change the Input, which means there is no way to modify the original input of the same compose,

 

For Variables, it should be the X parameter in the equation, which we could substitute with values,

Under the the running details, you should also noticed that it only contains Inputs, and it has the corresponding action to "Update" the X (original input) value.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Compose or use variable?

Hi @v-micsh-msft

Thank you for following up.  In any case I have now found this documentation:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-actions-triggers#compose-actio...

It is not too clear, but also gives some indications.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,306)