“I’m dividing two numbers to convert ticks to days but Power Automate gives me only full days as a result, ignoring the decimal numbers!”
If you divide numbers in Power Automate, e.g. to convert ticks to days to get a time difference, you’ll use the div(…) expression. But there’s a small inconvenience using it. By default, if you divide two whole numbers, it’ll return a whole number. It won’t return a decimal result, just the whole number part. Instead of 0.5 you’ll get a 0, instead of 2.3 you’ll get 2, etc. That’s not very helpful, especially if you’re trying to calculate some percentages.
How do you then tell it to return also the decimal part of the result?
Use decimal number as an input
The reason is that the expression keeps the input data type. You entered two whole numbers (integers), it’ll return another whole number (integer).
Since the expression sticks to the original input type, you must change the input. Instead of using two whole numbers convert one of them into a decimal number (float). Applying the float(…) expression will convert the input number, and together with that also the division result. It doesn’t matter which input it’ll be, you can pick any of them.
float(<number>)
Note: <…> is a placeholder, replace it including the < and >.
Following with the example from above, the difference between now and 12 hours ago is 0.5 days, not a 0.
Summary
When dividing numbers in Power Automate, you should always consider converting one of them into a decimal number (float). The result will be another decimal number and you won’t miss any piece of information (especially if you’re trying to calculate percentages).
Need your suggestion.
I am using SP document library for review purpose. I need to send email notification to users based on the “Review date”.
My action items, email need to send every 7 days based on the Review date. Example, my document review date is today means, an email notification need to send today, after that incase if document not review means, again email notification need to send next 7 days. Like that until the document reviewed, every 7 days email notification need to send users.
Example: suppose document review date 2023-07-23. Incase users missed to review then email notification need to send on 2023-07-30. Similar again if not review on 30th also another email notification need send 2023-08-06. Again of not review on 6th also another email need to send on 2023-08-13 and soon, until document review date changed.
Means based on review date it need to calculate past 7days date and send email something like
Note: Document review date fix and user will change manually. Please suggest us how to crack this functionality. I tried my way. Your suggestions are highly appreciations.
Hello Krishna,
I’d probably do it as explained here: https://tomriha.com/send-multiple-sharepoint-reminders-in-a-single-power-automate-flow/