Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Process answer lists within the parser #2210

Closed
jfmcquade opened this issue Feb 22, 2024 · 0 comments · Fixed by #2211
Closed

[FEATURE] Process answer lists within the parser #2210

jfmcquade opened this issue Feb 22, 2024 · 0 comments · Fixed by #2211
Labels
feature Work on app features/modules

Comments

@jfmcquade
Copy link
Collaborator

What?
Following on from #2204, it was agreed that it would be sensible to parse answer lists to object-arrays as part of the parser code, rather than handling at runtime. From this comment:

the answerlist is usually stored in an intermediate local variable which is an array (auto converted by parser for anything with _list in name), but whose elements are formatted string. So when the dynamic variables are replaced they are dropped into something like
["name: @local.name | text: @local.text"] -> ["name: undefined | text:undefined"]

So what would actually be better would be to process these within the parser to convert the string-array into an object-array. That way when replacing the localVariable it could already be formatted as:

[{
"name": "@local.name",
"text": "@local.text"
}]
Which when converted should replace the variables (local, data, field or anything else) it should be able to assign the proper value.

I think would make sense to merge what's here now to fix the issue in the short term, and then I'll try make a quick follow-up pr/issue to see if possible to update the parser as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Work on app features/modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant