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,
hi @GuyBoswell see everyting is about the data type, see when you said
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.
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?
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