Set time with a condition

  • Profile Image
    SouthernUnitedHC
    Asked on June 08, 2020 at 10:01 PM

    1591668761sett time.png

    I am trying to use a condition to calculate a fields value, and that value is  a time, but it is not working. Is it possible, and if so, what format should be?

     

    Thanks

     

     

  • Profile Image
    Vick_W
    Answered on June 09, 2020 at 01:31 AM

    Hey there,

    Happy to help you today,

    I would like to inform you that, we have a detailed guide available on how you can use time calculation. Please follow the link below.

    https://www.jotform.com/help/443-Mastering-Date-and-Time-Calculation

    If you need further assistance do let us know.

    Looking forward to your reply.

    Thanks

  • Profile Image
    SouthernUnitedHC
    Answered on June 09, 2020 at 02:21 AM

    Thanks, but that does not help. 

    I am wanting to use a condition to set the value of a time field.  But the format of the time field does not seem to allow it.  What I am wanting to know please is how/what format I need to have to be able to set a time field in a condition.


    Thanks

  • Profile Image
    Vick_W
    Answered on June 09, 2020 at 03:47 AM

    Hi,

    Thank you for writing back to us.

    Please provide Form ID of the form in which you are trying to apply this so we can further look into this.

    Looking forward to your response.

    Thanks.

  • Profile Image
    SouthernUnitedHC
    Answered on June 13, 2020 at 01:11 AM

    Sorry for the delay in responding.


    I have set up a test form https://form.jotform.com/201602140864041 which is trying to do the setting of a time field in a condition. 


    Thanks

  • Profile Image
    Vick_W
    Answered on June 13, 2020 at 02:34 AM

    Hey there,

    Thank you for writing back to us.

    I'm checking this for you and will get back shortly.

    Thanks

  • Profile Image
    Vick_W
    Answered on June 13, 2020 at 03:19 AM

    Hi there,

    Please correct me if I'm wrong. You want to show a specific time if someone selects an option from the list as shown in the form. For example Option A, Option B etc.

    I'm someone selects option A then a specific time slot should appear. A work around to do this is to use Show/Hide Fields in your conditions. You can use this option to show a pre defined time for each option.

    Please check out the user guide below:

    https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer

    Or do you want to give your users the ability to select a time of their own choice?

    Looking forward to your response.

    Thanks

  • Profile Image
    SouthernUnitedHC
    Answered on June 13, 2020 at 03:22 AM

    Sorry for not being clear.


    I want to set a time field based on a response.


    Eg if they selection option A I want to set the time field to 7pm

    if they selection option B I want to set the time field to 8.30pm

  • Profile Image
    Vick_W
    Answered on June 13, 2020 at 05:06 AM

    Hey there,

    Thanks for the clarification. Please have a look at this test form and see if this is what you are trying to achieve. I've used conditions and show/hide options. When you select option A, a predefined time slot appears and same with the option B. You can clone the form from the link below.

    https://form.jotform.com/201641413366953

    Please use following guide to see how you can clone a form.

    https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

    Looking forward to your response. 

    Thanks.

  • Profile Image
    SouthernUnitedHC
    Answered on June 13, 2020 at 05:49 AM

    Thanks, that doesn't really do the same thing as you then end up with two fields start time and two fields end time.  

  • Profile Image
    Ariel_P
    Answered on June 13, 2020 at 06:48 AM

    Hi,

    Thank you for reaching out to us.

    Seems like there's no other way to set the time conditionally other than copying a time value from another time field.

    So a workaround is to set a list of hidden time fields that your visible time field can copy values from.

    Here's a sample form https://form.jotform.com/201643029135952.

    Hope that helps. Don't hesitate to reach out if you need further assistance.

  • Profile Image
    SouthernUnitedHC
    Answered on June 13, 2020 at 07:01 AM

    Thanks, that is where I had ended up. I have found that works with a traditional layout but not a card form.

  • Profile Image
    Amin_N
    Answered on June 13, 2020 at 10:42 AM

    Since Card Forms are different from Classic Forms when it comes to conditionally showing/hiding fields, workarounds provided by my colleagues do not work with Card Forms, as you must move from one slide to another to recognize conditionally shown/hidden fields. 

  • Profile Image
    Amin_N
    Answered on June 13, 2020 at 10:59 AM

    By the way, going back to your original question, you can alternatively use normal drop-downs that contain hours, minutes and seconds. Then, use Conditional Logic to insert a specific time as shown below:

    1592060273Screenshot_2020-06-13 The Easi

    My demo form:

    https://form.jotform.com/201644751402043

  • Profile Image
    SouthernUnitedHC
    Answered on June 13, 2020 at 07:46 PM

    Thanks so much. You have been really helpful. I had no idea on this one.


    Since Card Forms are different from Classic Forms when it comes to conditionally showing/hiding fields, workarounds provided by my colleagues do not work with Card Forms, as you must move from one slide to another to recognize conditionally shown/hidden fields.