Converting time using Power Automate and Survey123

179
1
Jump to solution
01-28-2021 06:14 AM
DaveK
by
New Contributor III

Hello! 

I'm using Power Automate to send a confirmation email when a survey is submitted. I have a dateTime field within my survey and I am interested in converting the time to be understandable within an email. As I understand it the survey contains the date/time in Epoch time. I found an article explaining how to perform this conversion but I seem to be doing something wrong, because the Power Automate process throws an error on my expression. 

Link to the conversion article - https://support.esri.com/en/technical-article/000023954

And here is my expression - 

addSeconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['datetime'],1000))

 

If anyone has done this conversion before and has information it would be appreciated! 

Thanks. 

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Frequent Contributor

I think you are just missing the format string at the end.

  • In Power Automate, click on the body input box of your email action
  • Select Dynamic Content
  • Switch to the Expression tab
  • Type addSeconds('1970-1-1',Div(
  • Then insert the date value from the survey (switching momentarily to dynamic content to select your date question in the survey).
  • Your expression will look something like this: addSeconds('1970-1-1',Div(triggerBody()?['feature']?['attributes']?['yourdatequestion']
  • Now add ,1000),'yyyy-MM-dd')
  • Your final expression will be something like this

addSeconds('1970-1-1',Div(triggerBody()?['feature']?['attributes']?['yourdatequestion'] ,1000),'yyyy-MM-dd')

View solution in original post

0 Kudos
1 Reply
IsmaelChivite
Esri Frequent Contributor

I think you are just missing the format string at the end.

  • In Power Automate, click on the body input box of your email action
  • Select Dynamic Content
  • Switch to the Expression tab
  • Type addSeconds('1970-1-1',Div(
  • Then insert the date value from the survey (switching momentarily to dynamic content to select your date question in the survey).
  • Your expression will look something like this: addSeconds('1970-1-1',Div(triggerBody()?['feature']?['attributes']?['yourdatequestion']
  • Now add ,1000),'yyyy-MM-dd')
  • Your final expression will be something like this

addSeconds('1970-1-1',Div(triggerBody()?['feature']?['attributes']?['yourdatequestion'] ,1000),'yyyy-MM-dd')

View solution in original post

0 Kudos