cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GuyBoswell
Helper IV
Helper IV

Compose v. Variables

Hi All,

I am new to Power Automate but learning fast.  I am not a programmer, more like a smart user, so Power Automate and Power Apps seem ideal to me.  I learnt programming in Basic on a ZX Spectrum about 100 years ago.  I probably haven't really developed much beyond that, just adapted.
So I am used to declaring and setting variables.

Power Automate has steps for Initialize variable, Set variable and Format number.  These feel very familiar so I started using them.  But Format number, although it works fine doesn't seem to be useable in emails - at least not more than one formated number at a time.  I was advised to use Compose.

Now hang on one minute!?!  Compose seems to do away with the need for initialising, setting and formating variables - you can do them all in one step.  Fantastic!  So what am I missing?  Is there any reason not to use Compose everywhere and just do away with Initialize, Set and Format variables?

Well only one reason I have seen.  You can't readily search for Compose items in dynamic content.  You can search for, "outputs" and they are all listed.  But if you have a lot of them they are difficult to find, especially as they sort not alphabetically but in the order they were created.

OK! two reasons.  The 'Inputs' box and the, 'Expression', box are tiny and totally rubbish if you want to nest more than one function. 

I really would be interested in your thoughts.  Thank you,

Guy

3 REPLIES 3
ChristianAbata
Community Champion
Community Champion

hi @GuyBoswell  see everyting is about the data type, see when you said

 


@GuyBoswell wrote:

 

But Format number, although it works fine doesn't seem to be useable in emails - at least not more than one formated number at a time.  I was advised to use Compose.


this is because in body emails you need to add string variable that means text not int or others.

The secrete is on the datatype 😉

So you can iniciatize string variables too or array variable or int or double. 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Hi @ChristianAbata 

 

No, not sure it is that simple.  The datatype works OK.  I can add any one of my formatted numbers in an email and the email delivers fine.  Sometimes I can add two or three.  But if I add any more than that the email fails.  And the really odd behaviour is if I then delete the formatted number from the email it doesn't start working again.  I have to delete all the formatted numbers and start again.  Anyhow, there is an easy work around, use Compose.

 

So my point is if Compose works, why not use Compose everywhere and just give up on variables?

 

Guy

ohhh @GuyBoswell  its a good question, see in my experience I just use variable when I want to append something in there like a value from other action, or when I what to increment o decrement something. And Compose to know the result from action properties and do transformations with expression.s



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,704)