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?
Solved! Go to Solution.
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!
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.
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>
any other suggestions?
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.
@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
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.
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))
Yes, but you need another ), like this:
string(int(outputs('Compose_5')))
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?
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!
So just change compose 6 to:
string(int(outputs('Compose_5')))
User | Count |
---|---|
93 | |
39 | |
24 | |
21 | |
16 |
User | Count |
---|---|
129 | |
49 | |
48 | |
31 | |
25 |