Ajuda com com lógica condicional.

  • fazzapp
    Perguntado em 27 de março de 2024 às 14:22

    Olá amigos,

    Estou tendo dificuldades em estabelecer uma lógica condicional em um dos meus formulários.

    O problema está ocorrendo com as condicionais números 1 e 2 do meu formulário: https://form.jotform.com/240785256123658

    Basicamente, se o campo do widget Planilha para Formulário estiver vazio, o campo 8 pega o valor do campo 3 = (condicional 2)
    O problema ocorre quando, após ativar a condicional 2, se eu preencho o campo 7 (ativando a condicional 1) e depois volto a tornar este campo 7 vazio, a condicional número 2 passa a não responder mais.

    Por favor, veja o problema acontecendo pelo vídeo abaixo:
    https://drive.google.com/file/d/1sOlTVCnwlEbKCP3Y1KI8efcR_V1nu0w4/view?usp=sharing


    Por favor, me digam o que estou fazendo errado aqui.
    Obrigado.

  • Afzal Jotform Support
    Respondido em 27 de março de 2024 às 17:23

    Hi Carlos,

    Thank you for reaching out to Jotform Support. I am currently using a translation to provide assistance, but if you want to get assistance in Portuguese language, we can forward your request to our Portuguese Support Team, but please note that it may take longer to receive a response.

    I cloned your form and tested it to see if I could replicate the issue, but everything was working properly. Check out the screencast below to see my results:

    Ajuda com com lógica condicional Screenshot 20

    As you can see as soon as I click anywhere on the form after clearing the field 7, the condition is applied automatically. Please test it again after clearing your browser cache. If the issue persists, let us know and we'll do a more in-depth investigation and work on finding a solution.

    Let us know if there’s anything else we can help you with. 

  • fazzapp
    Respondido em 27 de março de 2024 às 17:55

    Ok, I forgot to mention that this field 7 was hidden, as it will only function as a design field, which will send the result to field 8 if the user enters a correct code in field 4.

    Well, now that I've hidden the fields that should be saved, I ask you to try it again, following the steps below:

    1. enter a value in field 3 (field 8 will show this same value)
    2. enter the code YFEWP in field 4 (field 8 will show the value of field 3 with 15% discount)
    3. change the code entered in step 2, or even let that field empty and you will see that field 8 does not show again what was entered in field 3, which means that the conditional number 2 stop working.

    If you watch my video you will see I'm doing exactly those steps.

    This is the problem.

  • Afzal Jotform Support
    Respondido em 27 de março de 2024 às 18:40

    Hi Carlos,

    Thanks for getting back to us. I cloned your form and tested it to see if I could replicate the issue, and I ran into the same problem. Let me show you how to fix it: 

    • Click on the Settings tab in the orange navigation bar at the top of the page.
    • In the menu on the left side of the page, click on Conditions.
    • Now, use the Update/Calculate Field element to create conditional rules as shown in the screenshot below.

    Ajuda com com lógica condicional Screenshot 20

    The above conditions will make sure if the field "Valor a pagar:" contains 0 it will copy the field value from the field Valor da viagem.

    Give it a try and let us know if you have any other questions.

  • fazzapp
    Respondido em 28 de março de 2024 às 06:38

    That's it !

    Thank you so much, my friend.