Select to view content in your preferred language

Survey123 >Automate > Excel - Date/time formatting issue

1305
2
Jump to solution
05-31-2023 01:28 PM
elpinguino
Occasional Contributor III

Hi Automaters,

New to using Microsoft Automate. Hoping this is a quick fix for someone.

I have set up a flow so when someone submits a survey123 that info gets written into a spreadsheet in Sharepoint. It's working great! Except for the date/time format in two fields...

The two fields are date fields in S123/AGOL, so I'm inputting them as dynamic content, and I want them to be in UTC + 12.

I was advised this could work- putting in an expression. 

formatDateTime(addHours(utcNow(triggerOutputs()?['body/feature/attributes/Contact_date']),12),'dd/MM/yyyy HH:mm')

The flow is failing though, and this is the error I'm getting.

Unable to process template language expressions in action 'Add_a_row_into_a_table_-_Consult_on_effects_Contractor' inputs at line '0' and column '0': 'The template language function 'utcNow' expects its parameter to be of type string. The provided value is of type 'Integer'. Please see https://aka.ms/logicexpressions#utcnow for usage details.'.

I posted in the Microsoft Automate Community forums on their website, but haven't gotten to the root of the problem yet. I thought maybe someone in this community has experienced it before since you're also AGOL users.

Thanks in advance for your help.

 

0 Kudos
1 Solution

Accepted Solutions
CoffeeforClosers
New Contributor III

Survey123 appears to be passing UNIX timestamps to your DynamicContent. Try instantiating a variable that converts your UNIX integer to a string and then format that in your Timezone offset expression.

https://powerusers.microsoft.com/t5/Building-Flows/Got-a-recipe-for-converting-a-unix-timestamp-to-a...

View solution in original post

2 Replies
CoffeeforClosers
New Contributor III

Survey123 appears to be passing UNIX timestamps to your DynamicContent. Try instantiating a variable that converts your UNIX integer to a string and then format that in your Timezone offset expression.

https://powerusers.microsoft.com/t5/Building-Flows/Got-a-recipe-for-converting-a-unix-timestamp-to-a...

elpinguino
Occasional Contributor III

Thank you so much @CoffeeforClosers . That was doing my head in! Fixed now!

0 Kudos