cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NguyenHuu
Helper III
Helper III

How to clear number "0" in email notification?

Hi All,

When i get the number from column in SharePoint List to Send email with option and there are many number "0" at email notification so do you know how to remove it?

NguyenHuu_0-1621845351521.pngNguyenHuu_1-1621845459192.pngNguyenHuu_2-1621845543810.png

if i put number by manual is OK, the number from Formula it will like that.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

hello @NguyenHuu ,

 

I built up the whole pipeline for you. Here it is (kudoe and solution wanted :P):

powercorner_0-1622051370252.png

I used exactly your formula for the "Total day leave" and got only 1 decimal place after the dot.

 

Then in the flow:

powercorner_1-1622051719699.png

 

my expression to calculate is:

float(concat(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[0],'.',substring(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[1],0,1)))

 

And it works like charm

 

With regards

Kevin

View solution in original post

11 REPLIES 11
powercorner
Resolver III
Resolver III

Hello @NguyenHuu 

 

its pretty easy. use the expression int() and wrap your sharepoint output into it. So int(total day leave) inside your mail body should fit it.

 

With regards

Kevin

Thanks @powercorner ,

But it can't show the  half day like 0.5 to 0 or 1.5 to 1 

Thanks.

powercorner
Resolver III
Resolver III

then you can do some math:

 

div(float(int(mul(YOURFLOAT,10))),10)

 

 

 

that is

 

take YOURFLOAT

multiple by 10

converting to int

converting to float (else it became an integer result)

dividing by 10

NguyenHuu
Helper III
Helper III

Hi @powercorner ,

Follow your step: 

div(float(int(mul(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],10))),10)
NguyenHuu_1-1621953218492.png

 

 

and it got problem like this: 

NguyenHuu_0-1621953045856.png

 

powercorner
Resolver III
Resolver III

Hmm okay then try a different approach with strings. Try this: (the expressions are in the comments)

powercorner_0-1621955259965.png

What I basically do is: 


- I split the float at the dot

- take the front as it is

- get the first letter from the back of the float 

- make it to a string again:

concat(split(string(variables('FloatNumber')),'.')[0],'.',substring(split(string(variables('FloatNumber')),'.')[1],0,1))

Hi @powercorner ,

i follow your steps:

2.PNG3.PNG

 

and get the error:

 

1.PNG

powercorner
Resolver III
Resolver III

I assumed you have a number coming from the SharePoint but its a string. so you can leave out the float variable initialization: begin with the splitting cause you already have a string.

 

concat(split(YOURSPVALUE,'.')[0],'.',substring(split(YOURSPVALUE,'.')[1],0,1))

 

btw why did you save a number of days in a string in the SP column? That sounds not good.

 

With regards

Kevin

 

 

 

 

 

 

 

Hi @powercorner ,

The number from Formula : =IF(Halfday=TRUE,((DATEDIF(StartDate,EndDate,"D"))-INT(DATEDIF(StartDate,EndDate,"D")/7)*2-IF(WEEKDAY(EndDate)<WEEKDAY(StartDate),2,IF(OR(WEEKDAY(EndDate)=7,WEEKDAY(StartDate)=1),1,0))+1)-0.5,((DATEDIF(StartDate,EndDate,"D"))-INT(DATEDIF(StartDate,EndDate,"D")/7)*2-IF(WEEKDAY(EndDate)<WEEKDAY(StartDate),2,IF(OR(WEEKDAY(EndDate)=7,WEEKDAY(StartDate)=1),1,0))+1))

 

NguyenHuu_0-1622040926754.png

NguyenHuu_1-1622041157599.png

 

so can you share me detail how to fix it?

Thanks

hello @NguyenHuu ,

 

I built up the whole pipeline for you. Here it is (kudoe and solution wanted :P):

powercorner_0-1622051370252.png

I used exactly your formula for the "Total day leave" and got only 1 decimal place after the dot.

 

Then in the flow:

powercorner_1-1622051719699.png

 

my expression to calculate is:

float(concat(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[0],'.',substring(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[1],0,1)))

 

And it works like charm

 

With regards

Kevin

View solution in original post

NguyenHuu
Helper III
Helper III

Thank so much @powercorner ,

it work 🙂

Thanks.

Huu.

NguyenHuu
Helper III
Helper III

Hi @powercorner ,

Do you know how to change format of date to DD-MM-YYYY?

NguyenHuu_0-1622453673864.png

Thanks

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,024)