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

1 REPLY 1
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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,204)