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.
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.
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.
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.
value = moment(data.dateTime).format('YYYY-MM-DD')
Within Microsoft Power Automate use the hidden component to set the date columns in the excel
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.
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.
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.
value = moment(data.dateTime).format('YYYY-MM-DD')
Within Microsoft Power Automate use the hidden component to set the date columns in the excel