web
You’re offline. This is a read only version of the page.
close
Skip to main content
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:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at
    Re: How to simplify 'Initialize value- Set value' process when there are multiple values need to be calculated

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard