[Ticket cloned from T11037: Carrying data from page 1 to page 4 in a survey /Vue combination]
Good afternoon.
I have 2 questions.
- I am calculating some numbers - like total allowances etc… in 2 pages in a survey and carry the numbers into a summary page in the same survey. This also works fine in Survey JS site. However, when this is added to a Vue project, the totals are not carried over. Is there a way the numbers can get carried over to the summary page? Then the users won't have to type these totals again.
Thank you so much.
~bharathi.
Hello Bharathi,
Would you please explain in detail how you calculate summaries over your survey? Do you use calculated fields or custom functions? Please feel fee to share an example for reference.
I look forward to your reply.
Hello Jane,
Bit more detail (longish)
This is for Travel Authorization -
I have an Employee Page, a Persons Page (for non-employee related items) and a summary page.
Both the Employee and Person pages have a mix of dynamic panels, plain or simple panels and other pieces of info. They capture allowances and actual arrangements.
I have expression boxes to display the totals from these data.
One of the expression is sumInArray({employeeList}, "employeeAllowanceTotal") - this is to display the total of allowances for all employees. This goes into expression field named {totalEmployeeAllowance}
EmployeeAllowanceTotal looks at items each employee has selected and adds them up.
Second expression on the Employees page is sumInArray({employeeList},"employeeArrangementsTotal").
Similar expressions in Persons Page.
Now in summary page -
I was trying a few things because the values did not carry over in Vue –
I tried {totalEmployeeAllowance} for one and sumInArray({employeeList},"employeeArrangementsTotal") for another field to test.
From the SurveyJS, the JSON is copied to a table in a SQL database as a JSON (max length character) field and used as a template for data entry such in the vue project.
This piece is done by my co-worker. So, if you need more info, I can find out.
In this data entry part, the summary fields display nothing and the phone number field allows characters.
Thank you so much.
Bharathi.
Hello Bharathi,
Thank you for the comprehensive explanation. Expression calculation should not basically depend on a programming platform of your application. So, it would be great if you can get a reproducible survey JSON for research.
One thing that comes to my mind: to ensure that the loaded survey JSON is well-formatted, i.e. doesn't contain any escape symbol combination which might (potentially) be inserted by a text editor.
I look forward to your reply.
I will check again for these escape symbols…
I have done one round of reviewing already. The form is pretty long – some I could have missed
Thanks again.
My pleasure. Please let me know if you have any questions.