How to calculate and prefill Quantity Ordered and Total Cost | XM Community
Skip to main content
!



I am wondering if there is java script code that would prefill the quantity ordered from the order detail question - a tabulation of the quantity ordered from the size section would need to be carried down to the size and pricing question. is there then a formula that could be used then to calculate the total cost based on the pricing of each size ordered. See attached.
I will add that I have very very little java script experience
Hi @Sludemann,



Can you share the QSF and I can share the code.



Regards,

Samarth
Here is the file. Thank you so much.
Here is the 2nd survey. I would assume the code will be applicable to apply to both scenarios.
> @Samarth said:

> Hi @Sludemann,

>

> Can you share the QSF and I can share the code.

>

> Regards,

> Samarth



Did I provide you with what you needed? Thanks again for any assistance you can provide.
Hi @Sludemann ,



Allow me some time I will revert back to you!



Regards,

Samarth
Thank you so much. We really want to kick this off early next week.
Hey @Sludemann! Although I do recognize you are asking for a custom code solution, you'll be able to accomplish something similar through the use of Math Operations and the Survey Flow. I would recommend reaching out to our Support team who can work with you to get this setup. 🙂
To make this setup more user-friendly we will have to change the second question and it should look like as shown in the screen-shot.

Also, to make this setup a little bit easy, the user will have to select the gender first and then enter the size info.



!



Apart from '" Total cost" calculation, the rest looks fine... you can take a look... below is the link



https://qimpl.az1.qualtrics.com/jfe/preview/SV_3F1UKb12nr3ZwHz?Q_SurveyVersionID=current&Q_CHL=preview



I can share the QSF with you... if you are still working on this setup.

Hi there, I am very interested to find out abou the codes behind this question format. I am looking to run a merchandise sales for my school and would like to learn how to calculate total costs too. Could you tell me more / share with me how it is done? Thanks a lot!


Leave a Reply