Hello. I am trying to have a field prepopulate an answer based on the results of previously asked questions. For example, the user is asked 1) what the date is, 2) which district they are working in, and 3) what plant they observed.
From those answers I would like to have the next question, "Site ID", prepopulate with results from these answers. For example, the Site ID would read: 0913E_TACA7_0323_001; where "0913E" is default text, "TACA7" is the plant code from a previous question, "03" is the District ID from a previous question, "23" is 2-digit year from a previous question, and "001" is the first observation of this plant (this would ideally be the only part the user would need to enter).
Please see attached image of survey form for name and labels.
Solved! Go to Solution.
Zach,
I think you're right that the concat() function is what I want to use here. However, I'm having some issues with the syntax. Currently I have:
concat('0913E_', ${Plant_Code}, '_', ${District_ID}, format-date(${Date}, '%y'), '_')
which is giving me the output:
0913E__23_
It's not picking up the first two ${question} items, but does seem to like the format-date. Am I missing something?
Thanks!
Zach,
I think you're right that the concat() function is what I want to use here. However, I'm having some issues with the syntax. Currently I have:
concat('0913E_', ${Plant_Code}, '_', ${District_ID}, format-date(${Date}, '%y'), '_')
which is giving me the output:
0913E__23_
It's not picking up the first two ${question} items, but does seem to like the format-date. Am I missing something?
Thanks!
Hello @choenig,
When you are seeing the 0913E__23_ output does the Plant_Code and District_ID questions have answers in the form?
Ok, it's working. In fact, it already was, I just forgot to test it by answering the questions and seeing it populate the concatenation 🙄 🤣 Thanks for your help!