I am trying to format the data of a calculated field within the flow to send in an email to show 2 decimal places. has anyone acheived this?
I have tried both Text and Round and several iterations of these functions and they come back as invalid templates.
Can anyone shine any light on this?
the value from the column is 1.50000000000 i only want to see 1.5
Solved! Go to Solution.
As far as I know, math functions currently supported in Microsoft FLow as "expressions" are the ones defined here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
I guess you can multiply by 100, convert into integer, get back to float and divide into 100; but I haven't tested myself; so unsure if both float() and int() accepts non-string parameters
Hope this helps
Proud to be a Flownaut!
As far as I know, math functions currently supported in Microsoft FLow as "expressions" are the ones defined here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
I guess you can multiply by 100, convert into integer, get back to float and divide into 100; but I haven't tested myself; so unsure if both float() and int() accepts non-string parameters
Hope this helps
Proud to be a Flownaut!
@efialttes thank you so much for your repsponse and the link you provided. With a little reading and some trial and error i have come up with the following:
if(or(greater(body('Create_item')?['Days_x0020_Total'], string (10)),equals(body('Create_item')?['Days_x0020_Total'],string(10))),take(body('Create_item')?['Days_x0020_Total'],4),take(body('Create_item')?['Days_x0020_Total'],3))
This basically looks at the value in the total days field and determines if it is greater or equal to 10, if yes then it will produce 4 place and if no it will produce 3 places.
works a treat
You are welcome. Thanks for sharing!
Proud to be a Flownaut!
There's still no generalized rounding solution in Flow, which means building solutions specific to your data. Here's an approach I took when I needed to round from three decimals (#.###) to two (#.##) for display purposes. Fortunately, I knew I'd always be getting data in a #.### format, but you could pretty easily extend this to find the decimal place if the number of places to the left of the decimal was unknown.
if(contains('56789', substring(string(triggerBody()['number']),4,1)),substring(string(add(triggerBody()['number'],0.01)),0,4),substring(string(triggerBody()['number']),0,4))
I just used your suggestion to round the result of my division formula:
Original expression:
div(variables('Sum'),5)
Which returned the full result, i.e 1.6666666 or similar.
I formatted it to 1 decimal using this expression:
div(float(int(mul(div(variables('Sum'),5),10))),10)
that is
Thanks for the hint!
It was not as simple, because int() and float() only accept string arguments. So you get a run-time error like this:
div(int(first(split(string(mul(123.456, 10.0)),'.'))), 10.0)The output was
123.4
Thanks to Damo_R I was able to round numbers for our case, with two numbers behind. A little bit ugly, but it works.
Initializing 2 variables.
variable var as string
first(split(string(mul(123.454, 1000.0)),'.'))
(you can put your number or varible where 123.454 is)
variable varTemp as Integer
int(variables('var'))
than we go on with a condition
if
int(last(variables('var')))
equal or even to 5
set var to
sub(add(int(variables('varTemp')),10),int(last(string(variables('varTemp')))))
else
set var to
sub(int(variables('varTemp')),int(last(string(variables('varTemp')))))
finally transform it to a float (int would slice the numer)
div(float(int(div(int(variables('var')),10))),100)
Here's a similar solution, but no temp variables are needed.
Uses variables('myFloat') to represent the number you want to round.
div(
add(
mul(variables('myFloat'), 1000),
sub(
if(
greaterOrEquals(
mod(mul(variables('myFloat'), 1000), 10),
5
),
10,
0
),
mod(mul(variables('myFloat'), 1000), 10)
)
),
1000
)
Or, all in one line:
div(add(mul(variables('myFloat'),1000),sub(if(greaterOrEquals(mod(mul(variables('myFloat'),1000),10),5),10,0),mod(mul(variables('myFloat'),1000),10))),1000)
The float is multilpiled by 1000 before doing modulo to avoid tiny-fraction math errors (e.g. returning 0.00499999... instead of 0.005).
Using add, sub, mul, div, and mod to round a float... a reasonable workaround... XD
If you're looking for an expression to format for currency with a thousands separator, see my expression in another post.
This can be done with the following
substring(string(triggerOutputs()?['body/tileValue'])),0,3)
Don't forget the decimal '.' counts as a character because this is a string not an actual intager. It is not actual rounding, but it accomplished what I needed for my email to look cleaner.
@StevenWade , thanks so much for sharing this. I want to limit my decimals to two points, can you please help me with what modification should I make in the expression you shared please, thanks in advance.
@jan-dolejsi thanks for sharing. I have a requirement to limit decimal points to two, so as an example: 40.325 should result into 40.33. Can you please help me with the revised formula, thanks in advance.
@degvalentine thanks for sharing, I used your expression for limiting decimals to two places and it seems to work well. Noticing a small issue, if the values are 2.2, 4.3 etc then the expression returns 2.2, 4.3 only but instead i want it to show 2.20, 4.30, is it possible? Please help.
Hi @Anonymous,
Actually, my hideous workaround is no longer needed. They added the "formatNumber" function. Please use that instead. Here's the syntax for common currency formatting (without currency symbol):
formatNumber(variables('myFloat), 'N', 'en-US')
Here's the doc for all available number formatting options: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
Thanks @degvalentine a lot for sharing this, I was stuck with this issue since 3 days and this helped me out, keep up the good work, cheers!!
p.s: it works great and gives me two decimal points.
@rafaelbenicio you should use the "formatNumber()" expression or the "Format Number" action.
Here are links to the standard formats and custom formats.
formatNumber(1.995,'N2') // returns "2.00"
Episode Fourteen of Power Platform Connections sees David Warner and Hugo Bernier talk to Microsoft PM Jocelyn Panchal, alongside the latest news, videos, product reviews, and community blogs.Ā Ā Ā Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.Ā Ā Ā Show schedule in this episode:Ā 00:00 Cold OpenĀ 00:32 Show IntroĀ 01:10 Jocelyn Panchal InterviewĀ 24:10 Blogs & ArticlesĀ 29:50 Outro & BloopersĀ Check out the blogs and articles featured in this weekās episode:Ā Ā https://www.nathalieleenders.com/Blog/index.php/;focus=STRATP_com_cm4all_wdn_Flatpress_42136159&path=?x=entry:entry230511-101930#C_STRATP_com_cm4all_wdn_Flatpress_42136159__-anchorĀ @NathLeendersĀ https://www.keithatherton.com/posts/2023-05-12-msbuild2023-cloud-skills-challenge/Ā @MrKeithAthertonĀ https://elliskarim.com/2023/05/13/how-to-find-files-in-onedrive-that-match-a-naming-pattern/Ā @MrCaptainKarimĀ https://www.linkedin.com/pulse/my-fond-memories-scottish-summit-2022-pranav-khurana/ @pranavkhuranaukĀ https://www.linkedin.com/feed/update/urn:li:activity:7061777660745560064/?updateEntityUrn=urn%3Ali%3Afs_feedUpdate%3A%28V2%2Curn%3Ali%3Aactivity%3A7061777660745560064%29Ā @thevictordantasĀ Action requested:Ā Feel free to provide feedback on how we can make our community more inclusive and diverse.Ā This episode premiered live on our YouTube at 12pm PST on Thursday 18th May 2023.Ā Video series available at Power Platform Community YouTube channel.Ā Upcoming events:Ā Power Apps Developers Summit ā May 19-20th - LondonĀ European Power Platform conference ā Jun. 20-22nd - DublinĀ Microsoft Power Platform Conference ā Oct. 3-5th - Las VegasĀ Join our Communities:Ā Power Apps CommunityĀ Power Automate CommunityĀ Power Virtual Agents CommunityĀ Power Pages CommunityĀ If youād like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions.Ā Ā
Welcome to ourĀ May 2023 Community Newsletter, where we'll be highlighting the latest news, releases, upcoming events, and the great work of our members inside the Biz Apps communities. If you're new to this LinkedIn group, be sure to subscribe here in the News & Announcements to stay up to date with the latest news from our ever-growing membership network whoĀ "changed the way they thought about code". Ā Ā Ā Ā LATEST NEWS "Mondays at Microsoft"Ā LIVE on LinkedIn - 8am PST - Monday 15th MayĀ - Grab your Monday morning coffee and come join Principal Program ManagersĀ Heather CookĀ andĀ Karuana GatimuĀ for the premiere episode ofĀ "Mondays at Microsoft"! This show will kick off the launch of the newĀ Microsoft CommunityĀ LinkedIn channel and cover a whole host of hot topics from across theĀ #PowerPlatform,Ā #ModernWork,Ā #Dynamics365,Ā #AI, and everything in-between. JustĀ click the image belowĀ to register and come join the team LIVE on Monday 15th May 2023 at 8am PST. Hope to see you there! Ā Ā Executive Keynote | Microsoft Customer Success Day CVP for Business Applications & Platform,Ā Charles Lamanna, shares the latestĀ #BusinessApplicationsĀ product enhancements and updates to help customers achieve their business outcomes. Ā Ā Ā Ā S01E13 Power Platform Connections - 12pm PST - Thursday 11th May Episode Thirteen of Power Platform Connections seesĀ Hugo BernierĀ take a deep dive into the mind of co-hostĀ David Warner II, alongside the reviewing the great work ofĀ Dennis Goedegebuure,Ā Keith Atherton,Ā Michael Megel,Ā Cat Schneider, and more. Click below to subscribe and get notified, with David and HugoĀ LIVEĀ in the YouTube chat from 12pm PST. And use the hashtagĀ #PowerPlatformConnectsĀ on social media for a chance to have your work featured on the show. Ā Ā Ā Ā UPCOMING EVENTS Ā European Power Platform Conference - early bird ticket sale ends! TheĀ European Power Platform ConferenceĀ early bird ticket sale ends on Friday 12th May 2023! #EPPC23Ā brings together the MicrosoftĀ Power PlatformĀ Communities for three days of unrivaled days in-person learning, connections and inspiration, featuring three inspirational keynotes, six expert full-day tutorials, and over eighty-five specialist sessions, with guest speakers includingĀ April Dunnam,Ā Dona Sarkar,Ā Ilya Fainberg,Ā Janet Robb,Ā Daniel Laskewitz,Ā Rui Santos,Ā Jens Christian SchrĆøder,Ā Marco Rocca, and many more. Deep dive into the latest product advancements as you hear from some of the brightest minds in theĀ #PowerAppsĀ space. Click here to book your ticket today and save!Ā Ā Ā DynamicMinds Conference - Slovenia - 22-24th May 2023 It's not long now until theĀ DynamicsMindsĀ Conference, which takes place inĀ Slovenia on 22nd - 24th May, 2023Ā - where brilliant minds meet, mingle & share! This greatĀ Power PlatformĀ andĀ Dynamics 365Ā Conference features a whole host of amazing speakers, including the likes ofĀ Georg Glantschnig,Ā Dona Sarkar,Ā Tommy Skaue,Ā Monique Hayward,Ā Aleksandar Totovic,Ā Rachel Profitt,Ā AurĆ©lien CLERE,Ā Ana InĆ©s Urrutia de Souza,Ā Luca Pellegrini,Ā Bostjan Golob,Ā Shannon Mullins,Ā Elena Baeva,Ā Ivan Ficko,Ā Guro Faller,Ā Vivian Voss,Ā Andrew Bibby,Ā Tricia Sinclair,Ā Roger Gilchrist,Ā Sara Lagerquist,Ā Steve Mordue, and many more. Click here: DynamicsMinds Conference for more info on what is sure an amazing community conference covering all aspects ofĀ Power PlatformĀ and beyond.Ā Ā Days of Knowledge Conference in Denmark - 1-2nd June 2023 Check out 'Days of Knowledge', aĀ Directions 4 PartnersĀ conference onĀ 1st-2nd June in Odense, Denmark, which focuses on educating employees, sharing knowledge and upgrading Business Central professionals. This fantastic two-day conference offers a combination of training sessions and workshops - all with Business Central and related products as the main topic. There's a great list of industry experts sharing their knowledge, includingĀ Iona V.,Ā Bert Verbeek,Ā Liza Juhlin,Ā Douglas RomĆ£o,Ā Carolina Edvinsson,Ā Kim Dalsgaard Christensen,Ā Inga Sartauskaite,Ā Peik Bech-Andersen,Ā Shannon Mullins,Ā James Crowter,Ā Mona Borksted Nielsen,Ā Renato Fajdiga,Ā Vivian Voss,Ā Sven Noomen,Ā Paulien Buskens,Ā Andri MĆ”r Helgason,Ā Kayleen Hannigan,Ā Freddy Kristiansen,Ā Signe Agerbo,Ā Luc van Vugt, and many more. If you want to meet industry experts, gain an advantage in the SMB-market, and acquire new knowledge about Microsoft Dynamics Business Central, click hereĀ Days of Knowledge Conference in Denmark to buy your ticket today! Ā COMMUNITY HIGHLIGHTS Check out our top Super and Community Users reaching new levels!Ā These hardworking members are posting, answering questions, kudos, and providing top solutions in their communities. Ā Power Apps:Ā Super Users:Ā @WarrenBelz,Ā @LaurensMĀ Ā @BCBuizerĀ Community Users:Ā Ā @Amik@Ā @mmollet,Ā @Cr1tĀ Ā Power Automate:Ā Super Users:Ā @ExpiscornovusĀ ,Ā @grantjenkins,Ā @abmĀ Community Users:Ā @Nived_Nambiar,Ā @ManishSolankiĀ Ā Power Virtual Agents:Ā Super Users:Ā @Pstork1,Ā @ExpiscornovusĀ Community Users:Ā @JoseA,Ā @fernandosilva,Ā @angerfire1213Ā Ā Power Pages: Super Users: @ragavanrajanĀ Community Users:Ā @Fubar,Ā @Madhankumar_L,@gospaĀ LATEST COMMUNITY BLOG ARTICLESĀ Power Apps Community BlogĀ Power Automate Community BlogĀ Power Virtual Agents Community BlogĀ Power Pages Community BlogĀ Check out 'Using the Community' for more helpful tips and information:Ā Power AppsĀ ,Ā Power Automate,Ā Power Virtual Agents,Ā Power PagesĀ
Super Users ā 2023 Season 1Ā Ā We are excited to kick off the Power Users Super User Program for 2023 - Season 1.Ā Ā The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.Ā Ā Ā Ā Super User Season 1 | Contributions July 1, 2022 ā December 31, 2022Ā Super User Season 2 | Contributions January 1, 2023 ā June 30, 2023Ā Ā Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.Ā Power AppsĀ Power AutomateĀ Power Virtual AgentsĀ Power PagesĀ Pstork1*Ā Pstork1*Ā Pstork1*Ā OliverRodriguesĀ BCBuizerĀ Expiscornovus*Ā Expiscornovus*Ā ragavanrajanĀ AhmedSalihĀ grantjenkinsĀ renatoromaoĀ Ā Mira_Ghaly*Ā Mira_Ghaly*Ā Ā Ā Sundeep_Malik*Ā Sundeep_Malik*Ā Ā Ā SudeepGhatakNZ*Ā SudeepGhatakNZ*Ā Ā Ā StretchFredrik*Ā StretchFredrik*Ā Ā Ā 365-Assist*Ā 365-Assist*Ā Ā Ā cha_chaĀ ekarim2020Ā Ā Ā timlĀ Hardesh15Ā Ā Ā iAm_ManCatĀ annajhaveriĀ Ā Ā SebSĀ RhiassuringĀ Ā Ā LaurensMĀ abmĀ Ā Ā TheRobRushĀ Ankesh_49Ā Ā Ā WiZeyĀ lbendlinĀ Ā Ā Nogueira1306Ā Kaif_SiddiqueĀ Ā Ā victorcpĀ RobElliottĀ Ā Ā dpoggemannĀ srduvalĀ Ā Ā SBaxĀ CFernandesĀ Ā Ā RoverandomĀ schwibachĀ Ā Ā AkserĀ CraigStewartĀ Ā Ā PowerRangerĀ MichaelAnnisĀ Ā Ā subsgutsĀ David_MAĀ Ā Ā EricRegnierĀ edgonzalesĀ Ā Ā zmansuriĀ GeorgiosGĀ Ā Ā ChrisPiaseckiĀ ryuleĀ Ā Ā AmDevĀ fchopoĀ Ā Ā phipps0218Ā tom_rihaĀ Ā Ā theapurvaĀ takolota Ā Ā Akash17Ā momlo Ā Ā BCLS776Ā Shuvam-rpa Ā Ā rampprakashĀ ScottShearer Ā Ā RuskĀ ChristianAbata Ā Ā cchannonĀ Koen5 Ā Ā a33ikĀ Heartholme Ā Ā AaronKnoxĀ okeksĀ Ā Ā MatrenĀ David_MA Ā Ā Alex_10Ā Ā Ā Ā Jeff_ThorpeĀ Ā Ā Ā poweractivateĀ Ā Ā Ā RamoleĀ Ā Ā Ā DianaBirkelbachĀ Ā Ā Ā DavidZoonĀ Ā Ā Ā AJ_ZĀ Ā Ā Ā PriyankaGeethikĀ Ā Ā Ā BrianSĀ Ā Ā Ā StalinPonnusamyĀ Ā Ā Ā HamidBeeĀ Ā Ā Ā CNTĀ Ā Ā Ā Anonymous_HippoĀ Ā Ā Ā AnchovĀ Ā Ā Ā KeithAthertonĀ Ā Ā Ā alaabitarĀ Ā Ā Ā Tolu_VictorĀ Ā Ā Ā KRiderĀ Ā Ā Ā sperry1625Ā Ā Ā Ā IPC_ahaasĀ Ā Ā Ā zuurg Ā Ā Ā rubin_boerĀ Ā Ā cwebb365Ā Ā Ā DorrindaĀ Ā Ā G1124Ā Ā Ā GabibalabanĀ Ā Ā Manan-MalhotraĀ Ā Ā jcfDanielĀ Ā Ā WarrenBelzĀ Ā Ā WaegemmaĀ Ā Ā drrickrypĀ Ā Ā GuidoPreiteĀ Ā Ā metsshanĀ Ā Ā If an * is at the end of a user's name this means they are a Multi Super User, in more than one community.Ā Please note this is not the final list, as we are pending a few acceptances.Ā Once they are received the list will be updated.Ā
We are excited to share the āPower Platform Communities Front Doorā experience with you! Ā Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well. Ā Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities. Ā Ā Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.Ā Ā Ā Explore Power Platform Communities Front Door today. VisitĀ Power Platform Community Front doorĀ to easily navigate to the different product communities, view a roll up of user groups, events and forums.
We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida. Ā Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more. Ā Register today: https://www.powerplatformconf.com/Ā Ā
User | Count |
---|---|
40 | |
32 | |
28 | |
25 | |
11 |
User | Count |
---|---|
78 | |
43 | |
38 | |
28 | |
18 |