web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to simplify 'Initi...
Power Automate
Unanswered

How to simplify 'Initialize value- Set value' process when there are multiple values need to be calculated

(0) ShareShare
ReportReport
Posted on by

Good day, 

 

The flow I built is to update SharePoint from Excel Online. 

In the excel file, there are 6 columns with dates in a serial format (e.g. 44346.2291666667). In order to show it correctly in SP, I need to, for each column,  initialize variable 1 (float)-> initialize variable 2 (string) -> Set variable 2 with value addSeconds('1899-12-30',int(formatNumber(mul(variables('variable 1'),86400),'0','en-us')),'yyyy-MM-dd HH:mm:ss').

Dororo_0-1623838747805.png

 

Since there are 6 columns, my flow has 12 initialized variables, and 6 set variables. 

Is there any way to simplify the flow? 

 

P.s., Also tried to initialize variable 1 &2 as Object ( instead of float and string), but got an error in "Set Variable" since the MUL function in the formula cannot calculate Object variables

 

Categories:
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @Dororo ,

    if you move all the logic into the expression then you won't need any variable. Instead of initializing a variable you can use the dynamic contents directly in the expression. I suppose the number comes from an Excel row, so instead of storing it in a variable you can use directly the Excel row value. Take the value you store in the variable 1 and replace it in the expression

    addSeconds('1899-12-30',int(formatNumber(mul(variables('variable 1'),86400),'0','en-us')),'yyyy-MM-dd HH:mm:ss')
    =>
    addSeconds('1899-12-30',int(formatNumber(mul([PlaceholderForVariable1Value],86400),'0','en-us')),'yyyy-MM-dd HH:mm:ss')

    and then you can take the whole expression and store in in the SharePoint list

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard