Join the Team Forms community

Date Format for Excel

Updated 4 months ago

I need a Date component to translate to Excel through power automate. The Date component automatically picks up the date with moment() and the power automate is creating a new row in a table when form is submitted but the flow isn't working because of the format.

Marked as solution

Hi Tom

From my testing it looks like the Power Automate Excel Online action requires the dates to be in the form at yyyy-mm-dd. You can use the expressions in Microsoft Power Automate to achieve this however that is typically harder than performing this transformation in Team Forms as a calculated value. Heres what I did to get this working.


  1. Drag and drop you date/time component into your form and set the default value. Note I recommend using the method outline in this post to default the date to the current date as it will likely have less time zone related issues.

  2. Drag and drop a hidden component into your form and navigate to the data tab and set the calculated value to the expression below. Note that you may need to adapt the code to suit your specific form.

    JavaScript
    value = moment(data.dateTime).format('YYYY-MM-DD')
  3. Within Microsoft Power Automate use the hidden component to set the date columns in the excel


View full solution
E
1 comment

Hi Tom

From my testing it looks like the Power Automate Excel Online action requires the dates to be in the form at yyyy-mm-dd. You can use the expressions in Microsoft Power Automate to achieve this however that is typically harder than performing this transformation in Team Forms as a calculated value. Heres what I did to get this working.


  1. Drag and drop you date/time component into your form and set the default value. Note I recommend using the method outline in this post to default the date to the current date as it will likely have less time zone related issues.

  2. Drag and drop a hidden component into your form and navigate to the data tab and set the calculated value to the expression below. Note that you may need to adapt the code to suit your specific form.

    JavaScript
    value = moment(data.dateTime).format('YYYY-MM-DD')
  3. Within Microsoft Power Automate use the hidden component to set the date columns in the excel