cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bryanc78
Helper II
Helper II

Flow to send email is not displaying 0, it's just blank

I have a SharePoint list that has a calculated column to give me a number score(0 to 100, just like a school test)

Flow adds decimals to that score when it sends an email so I needed to convert it to a integer to correct it.

It works but now the email that the flow is sending is not showing a 0 score, it's just blank where the 0 should be.

 

Compose 5 - my score column from the SharePoint list

Compose 6 - int(outputs('Compose_5'))

Format Number - it outputs Compose 6 and formats it as  ### (this should get me from 0-100)

 

Any ideas?

 

Capture.PNG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Personally I wouldn't bother with any of the compose steps, but you can change your compose 6 to do the int and string conversion in one step.

 

I would just put the expression directly into the HTML, but lets get your process working first!

View solution in original post

16 REPLIES 16
Paulie78
Super User
Super User

If you look at the run history, what does the Format Number action tell you?

It would also be worth looking at the HTML of the send email action (when it is received) so that you can see what has come through in the HTML source. 

@Paulie78 

 

Here is the result of the flow

 

Your most recent score of  </span><span style="font-family: arial"><b></b></span><span style="font-family: arial"> did not meet the minimum score criteria.

 

It's like the 0 is being ignored.  Was changing it to a integer not the way to do this so the number doesn't show a decimal?

 

Here is another one that worked correctly

 

Great job! Your most recent test score is </span><span style="color: #169e46"><strong></strong></span><span style="color: #169e46"><strong>100</strong></span><span style="color: #169e46"><strong></strong></span><span style="font-family: arial,font">. Please see below for feedback, including any opportunities for improvement.<br>
<br>

bryanc78
Helper II
Helper II

any other suggestions?

Paulie78
Super User
Super User

You need to look at the run history to see what the ouput of the format number step was. Ideally, take a screenshot of the entire flow, and in your case, take a screenshot of the entire run history (expand everything out). If it is too big to take a single shot, use this guide I wrote:

https://www.tachytelic.net/2020/10/screenshot-entire-flow-power-automate/

I am sure it can easily be sorted out. 

bryanc78
Helper II
Helper II

@Paulie78   I did include a screenshot from the output history.  Should I have sent something else?

You included the compiled HTML output, which is useful in that it shows your value didn't come through. But in order to determine why it did not come through, it is useful to see what happened in the steps prior to that (because it would appear to be empty).

@Paulie78  I followed your guide but the screenshot is very tiny.  Also, my original post has screenshots of the items that impact the number

Paulie78
Super User
Super User

It's not tiny, it's huge (but appears tiny due to the zoom level), you have to crop it after. But if you don't know how to do that, just upload it to imgbb and I will zoom in on it there.

bryanc78
Helper II
Helper II

@Paulie78 

 

Looks like it's the formatting that's doing it

 

Capture.PNG

Paulie78
Super User
Super User

You're right, I just tested it with FormatNumber and it does not behave as you would expect if the number is zero. So I suggest you wrap your int into a string function instead of using format number. So it would be like:

 

string(int(your number))

bryanc78
Helper II
Helper II

@Paulie78 

 

So, remove Format Number and update Compose 6 to

 

string(int(outputs('Compose_5'))Capture1.PNG

 

Yes, but you need another ), like this:

string(int(outputs('Compose_5')))

@Paulie78 

 

Im confused now.  The original Compose 6 is to convert it to an int.  So keep that and then add a Compose 7 to convert the int to a str?

Paulie78
Super User
Super User

Personally I wouldn't bother with any of the compose steps, but you can change your compose 6 to do the int and string conversion in one step.

 

I would just put the expression directly into the HTML, but lets get your process working first!

View solution in original post

@Paulie78 

 

This worked.  Thank you for all your help

Paulie78
Super User
Super User

So just change compose 6 to:

string(int(outputs('Compose_5')))

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,356)