Hi,
I was able to successfully build a scheduled flow to update/add text and $ fields from a read-only Excel file to a SharePoint List. I have not been successful in getting 4 date fields (for 1 record) populated into the List. Here are the details I'm working with and hope someone can provide some help:
- In some cases, the date fields have not yet be populated so they are blank and I wish for them to remain blank and only updated in my List as applicable during schedule runs.
- Two of the dates fields are Date and Time: "Last Approval Date": "43684.6311919329" and "Submitted Date": "43340.5425716088"
- The other two dates are just Dates only: "Start Date": "42826" and "End Date": "43951"
- I Initiated Variables for each date at the very beginning as I remember from my coding days and have tried both setting them as Integer and Float types.
Of the several things I have tried and seen I'm now just lost and confused and have so many questions.
- What Type should I be using for the initial variable? I initially used Float for the fields that had Date and Time, and Integer if it was Date only.
- Do I need to use Set Variables or Compose with the formulas? Here are the formulas I captured.
Date only formula: | addDays('1899-12-30',int(item()?['YourDate']),'mm/dd/yyyy') |
Date and Time formula: | addSeconds('1899-12-30',int(formatNumber(mul(variables('SerialDateTime'),86400),'0','en-us')),'mm/dd/yyyy HH:mm:ss') |
*YourDate and SerialDateTime should reflect the Excel field name?
3. At what level in my flow am I supposed to put the Variable set and/or compose with formula to see success in the output to be ready to be updated in my SharePoint List? I got errors about 'valid arrays', 'not a string type', and others during my varied combination attempts.
4. How do I account for if the date field in Excel is blank without it giving me errors?
Here is an overview of my flow. All date fields have been left blank to get at least some data I can work with, but of course the full efficiency that can be realized by PowerAutomate is yet to be realized until I can get the Date field issues resolved.
Thanks in advance!