format-date issue in web form

391
2
Jump to solution
04-27-2022 04:23 PM
ChrisRoberts2
Occasional Contributor III

Hi All

I have created a form in survey123 connect and as part of that I create a unique ID which is a concat of the user ID and the current date and time:

concat(${observername},"_",format-date(once(now()), '%y%m%d%H%M%S'))

This works fine in the Survey123 app eg 9359_220427140725

However if I use the webform (desktop browser) I get this result: 9359_Invalid Date

Does anyone have any suggestions?

Cheers, Chris

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

once would generally be used like this:

once(concat(${observername},"_",format-date(now(), '%y%m%d%H%M%S')))

However, it is not guaranteed that ${observername} has a value when the form is loaded. You may want to consider using

concat(${observername},"_",format-date(now(), '%y%m%d%H%M%S')

 

View solution in original post

2 Replies
IsmaelChivite
Esri Notable Contributor

once would generally be used like this:

once(concat(${observername},"_",format-date(now(), '%y%m%d%H%M%S')))

However, it is not guaranteed that ${observername} has a value when the form is loaded. You may want to consider using

concat(${observername},"_",format-date(now(), '%y%m%d%H%M%S')

 

ChrisRoberts2
Occasional Contributor III

Thanks for the rapid response Ismael!

You are right that with once the observer id wasnt populating.  However the second option works...although I had to add another close bracket at the end 🙂

concat(${observername},"_",format-date(now(), '%y%m%d%H%M%S'))

0 Kudos