cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jalastrag28
New Member

Format Datetime from Survey123 to row table excel

Hello to every one, i'm a new user in this wonderful app, but in my trying to understand the use of this app i have had troubles customizing my date of register from survey123 to a row in table excel. 

 

I have written this piece of function in my box 

formatDateTime(concat(addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['FECHA'],1000) , 'dd/MM/yyyy'),' ',triggerBody()?['feature']?['attributes']?['HORA']), 'dd/MM/yyyy hh:mm')
 
but i have the follow error message:
Unable to process template language expressions in action 'Add_a_row_into_a_table' inputs at line '1' and column '2906': 'In function 'formatDateTime', the value provided for date time string '19/11/2020 18:49' was not valid. The datetime string must match ISO 8601 format.'.
 
I would like asking what is the  suitable way to concat a date which represents  "dd/mm/ YYYY " and an Hour (string format) which represents "hh:mm" and then represent this variables as one variable in date format to print in a row table of excel...
 
I really appreciate your helping.
1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @jalastrag28 :

Firstly, let me explain why you encountered this problem.

The point is the value of

concat(addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['FECHA'],1000) , 'dd/MM/yyyy'),' ',triggerBody()?['feature']?['attributes']?['HORA'])

do not match ISO 8601 format.

The correct ISO 8601format is

yyyy-MM-ddThh:mm

Finally, please try this formula:

formatDateTime(concat(addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['FECHA'],1000) , 'yyyy-MM-dd'),'T',triggerBody()?['feature']?['attributes']?['HORA']) , 'dd/MM/yyyy hh:mm')

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @jalastrag28 :

Firstly, let me explain why you encountered this problem.

The point is the value of

concat(addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['FECHA'],1000) , 'dd/MM/yyyy'),' ',triggerBody()?['feature']?['attributes']?['HORA'])

do not match ISO 8601 format.

The correct ISO 8601format is

yyyy-MM-ddThh:mm

Finally, please try this formula:

formatDateTime(concat(addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['FECHA'],1000) , 'yyyy-MM-dd'),'T',triggerBody()?['feature']?['attributes']?['HORA']) , 'dd/MM/yyyy hh:mm')

Best Regards,

Bof

karyal
Regular Visitor

I am having the same issue. Could you please provide the complete workflow? 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,219)