Hey everyone,
I’m hoping to get some advice on a challenge I’m facing with one of our surveys in Survey123. I’m not sure if what I’m trying to do is even possible, so any help would be really appreciated!
We’ve got a pretty big survey with 86 questions, each having a score (most are worth 1 point, 6 are worth 2 points, and 1 is worth 3 points, totaling 100). The survey feeds into a Power BI report and a Power Automate flow, so we can’t make many changes without creating a lot of extra work or causing issues down the line.
Now, my colleagues want a simplified version of the survey for field workers, but they still want it to match the original survey. The tricky part is that the simplified version has fewer questions, but the responses need to fill in the original questions.
I’ve tried adding some conditions in the simplified survey, but I’ve hit a dead end. Multiple questions in the simplified version need to match several questions in the original, and I can’t seem to get the logic right. I also tried linking the last response from the simplified version to the original one, but that didn’t work either.
I thought about using timestamp fields as a workaround, but that’s not ideal since the feature layer is already pretty large, and I’m worried it could cause performance issues.
Has anyone faced something similar or have any ideas on how to make this work?
A few extra details:
Thanks so much for any help or ideas!
Disclaimer: I don't have much to add.
This could be tricky... They are essentially asking you to make x = x-y. That's not normally how math works. Sometimes, people just need to be told "no".
Now, assuming you can make x = x-y, you'd need to automate all the "missing" fields somehow. I've done semi-similar things in the past where I took common/standardized responses to questions, dumped them in a CSV, and used something like pulldata() to extract the extra bits of data. Only you will be able to determine how to achieve this as there are some large gaps (at least from what I can tell) in the provided data.
Thanks for your thoughts on this @abureaux. At first, I thought that I might be missing something here, but turns out that this is very complicated and not the way things should be. I'll go back to my colleagues and rethink this logic.
I suspect that you are approaching this the wrong way - trying to write new survey that replaces the original but generates the same fields.
What you should do is leave the original survey mostly intact. Just set the "body::esri:visible" field to "no" for all fields. That way the original fields will remain exactly the same.
Now, write you simplified survey beneath the original. Set all the bind::esri:fieldType fields to 'null' so these questions are never uploaded.
Now, use the required simplified questions in the "Calculation" field of the corresponding original. Now, as the simplified are answered, they automatically populate the original question fields.
This way you don't need to set any conditions, or alter any calculations or change anything downstream. The data that is uploaded is identical to the original in every respect, all the change exist only on the collection devices.
I've attached an example using your simplification criteria for 5.3. (I haven't made the old questions invisible so you can see what's happening. Change that to see what the user would experience). The user only has to answer a single question, and that question auto-populates the appropriate questions in the original survey. The survey that is uploaded is exactly the same as the original in all respects, so no changes need to be made to PowerBI or anything else downstream.
Hi @LaurenceTait, thanks for taking the time to answer my question. Your suggestion solves 80% of my issue. I got the same input from our Esri provider with a small Javascript that will calculate the last responded question and will update the original fields accordingly.