
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').
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
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