Survey123 label doesn't display values from calculated

143
2
Jump to solution
04-29-2019 10:03 AM
Highlighted
Occasional Contributor III

Survey123 is still logging our users out approximately on a weekly basis I've heard. When this happens, the username field is not populated and users can't submit their surveys because its a required field.

As a workaround, I have a text input appear when the username is not present.

My survey looks like this:

typenamelabelcalculationrelevantExplanation
textinspectorInspector${username}${username} = ''If user isn't signed in, let them enter a username so the survey still submits
usernameusernameusernameTry and auto populate the username variable
labelInspectionMetaInspectionconcat("Inspector: ", ${inspector})Display the username to the user so they know they are signed in.

BUT this breaks the label. Inspector is never displayed to the user.

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Frequent Contributor II

When there is a username inspector hides - which causes it to go to "".  Whenever any field hides due to the relevant it will always blank the field (it does NOT just hide it but sets it to empty string).  So above when there is a username the field hides - which overrides the calculation and blanks it.

Remove the calculation from inspector

Use an if in the label.

if( ${username} = '', concat("Inspector: ", ${inspector}), concat("Inspector: ", ${username}))

View solution in original post

2 Replies
Highlighted
Frequent Contributor II

When there is a username inspector hides - which causes it to go to "".  Whenever any field hides due to the relevant it will always blank the field (it does NOT just hide it but sets it to empty string).  So above when there is a username the field hides - which overrides the calculation and blanks it.

Remove the calculation from inspector

Use an if in the label.

if( ${username} = '', concat("Inspector: ", ${inspector}), concat("Inspector: ", ${username}))

View solution in original post

Highlighted
Occasional Contributor III

That works! Thanks Doug!

Reply
0 Kudos