How to send a hidden rating element value to number field?

  • Profile Image
    sasannikookar
    Asked on December 31, 2017 at 11:51 PM

    Hi everyone,

    I have a drop list (with No and Yes options), a rating (5 starts) and a number element on my form.

    I want to show the value of the rating in the number element. Also, when the drop list is set to NO option, the rating element is hidden and when the YES option is selected then it shows.

    The problem is that when the rating element is hidden, it looks like there is no value for rating element, therefore, nothing shows in the number element on the form, but when the rating is not hidden and I can select the starts, I can see the result in the number element.

    I even set the default value of the rating element to 1 (it is not my preferred way), but nothing shows in the number element when the rating element is hidden.

    I even put another rating element and set it to 1 and make it hide and sent a condition on drop list for No option to copy the value of the second rating to the first one. But it does not work either.

    It looks like when I use the condition to set the field to the rating element and I want to check the rating element with Filled or Grather than then it does not work.

    Do you have any advice to help me for getting and showing the value of a hidden rating element to a number element?

    Thank you.

     

  • Profile Image
    Ardian_L
    Answered on January 01, 2018 at 08:17 AM

    Usually hidden elements are used for calculation purposes or for administration purposes. So I think a hidden rating element is not suitable to use in your case. 

    If you need just to calculate the rating I would suggest to use the Form Calculation Widget. You can calculate the rating and hide the field so you can use for you administration purposes

    Please check the demo form I have created. You can clone it and analyze it.

    Let us know if you have any other question.

  • Profile Image
    sasannikookar
    Answered on January 01, 2018 at 04:47 PM

    Hi Ardian,

    Thank you for letting me know.

    I do not use rating for doing the calculation.

    My scenario is that I have a couple of drop list elements with (Yes, No answers) and each one has a rating element as well that show or hide based on an item in the drop list options.

    At the end, I need to calculate the sum of the rating elements to show a number element.

    If people select No option, then I want to do not show the rating element for that drop list and consider the rating value 1 and use this value in my calculation to show in the number element.

    For calculation, I use the "Update/Calculate Field" condition. It looks like when we hide a rating element it loses its value even we set it by default to 1 and if we set the value for it through using "Update/Calculate Field" condition, it does not work.

    I have tested the From Calculation, but I still get the same result. I think the main question is that how we can set a value for a rating element when the form is loaded or more importantly when the rating element is hidden (setting value not through clicking on the rating elements as it works).

    Could you please advise me on this scenario?

    Thank you.

  • Profile Image
    jonathan
    Answered on January 01, 2018 at 05:57 PM

    The SETTINGS / Form Settings / Clear Hidden Field Values configuration could be causing the hidden fields to lose the value once hidden. 

    Can you try first set the option to "Don't Clear" then observe/test again.

    Ex:

    1514847414zzz 2018-01-02 06.55.31.png


    Let us know how it goes.

  • Profile Image
    sasannikookar
    Answered on January 01, 2018 at 07:09 PM

    Hi Jonathan,

    Thank you for letting me know. I have set it to "Don't Clear", but it does not work.

    I have created an example to show you the situation.

    https://www.jotform.com/build/61580433933860

    In this demo. It has 2 examples:

    1) In the first example, I set the ranking element to 1 through using "Update/Calculate Field" condition and also copy the value of the ranking element into the number element.

    2) In the second example, I set the default value of ranking element to 1 and also copy the value of ranking element into the number element. In this example, even the first star is select and it is yellow (because of the setting of the default value), but the number is 0 in the number element until you click on the first star again. It looks like it the default value or set the value of a ranking element do not work until you click on the ranking element!

    Please advise me on it.

    Thank you.

  • Profile Image
    Kiran
    Answered on January 01, 2018 at 10:17 PM

    I am checking on this issue. Please allow me sometime to check and get back to you with relevant information.

    Thank you!

  • Profile Image
    Kiran
    Answered on January 02, 2018 at 12:38 AM

    I understand that you want to display the star rating only when the drop down is YES so that the user can select the rating. If the drop down is selected as NO, the default value of the rating should be 1 and the field is hidden. I see that you have set a condition on the form to send the rating value to the number field when the drop down is selected as No. Considering the hidden rating field, please check if sending the value 1 directly to the number field instead of the rating field. Please see the screenshot below:

    1514884181Selection_012.png

    Please check the form below to see if that works for you

    https://form.jotform.com/80011094752953

    Let us know if you need any further assistance. We will be happy to help.

  • Profile Image
    sasannikookar
    Answered on January 02, 2018 at 01:00 AM

    Hi Kiran,

    Yes, exactly, but how you did it. I applied on my form (actually) I had it, but it does not work for me.

    How you set one for Ranking element.

    Could you please put photos related to all conditions or other setting that you have used?

    https://www.jotform.com/build/61580433933860

    or if you can please check my form and let me know what wrong is it.

    I think I cannot properly set the 1 for ranking element when it is No.

    Also, the good thing about your example is that it keeps the value for ranking element when drop list is set to yes and when I change to No and back to Yes, I can see it again. Exactly what I need!

    Thank you in advance.

  • Profile Image
    Kiran
    Answered on January 02, 2018 at 04:21 AM

    Oops! I have attached a wrong screenshot in my earlier post. I am sorry about that. Here is the condition that I set on the form to send the value 1 to the number. I have updated the screenshot on my earlier post also. It is just required to change the result field from Rating field to Number in the condition shown below:

    1514884863Selection_013.png

    1514884349Selection_012.png

    Since the calculation will be based on the number field, the number is directly assigned to number field instead of sending it to the rating field which doesn't work on the form load. So, when the dropdown is selected as NO, the rating field will be hidden and no value is stored. However, the number field will be set as 1. 

    Hope it works for you. Let us know if you need any further assistance. We will be happy to help.

  • Profile Image
    sasannikookar
    Answered on January 02, 2018 at 09:50 PM

    Hi Kiran,


    Many thanks :)