[Português]
Olá, pessoal!
Estou criando uma tela em que o usuário seleciona um paciente em um Dropdown Search, e ao selecionar também um exame (via Dropdown Tags), o botão "Criar Consulta" é exibido.
O comportamento desejado é que, quando o usuário clicar no "X" do Dropdown Search (limpando o paciente selecionado), o botão "Criar Consulta" desapareça automaticamente.
Porém, no momento, mesmo clicando no "X" e removendo o paciente, o botão continua visível.
Alguém poderia me orientar sobre a melhor forma de implementar essa lógica? Qual seria a forma mais adequada de verificar se o paciente está vazio para esconder novamente o botão?
Agradeço desde já pela ajuda!
[English]
Hi everyone,
I’m building a screen where the user selects a patient in a Dropdown Search, and after also selecting an exam (via Dropdown Tags), the "Create Appointment" button is displayed.
The expected behavior is that when the user clicks the "X" in the Dropdown Search (clearing the selected patient), the "Create Appointment" button should disappear.
However, right now, even after clearing the patient selection with the "X", the button remains visible.
Could someone guide me on the best way to implement this logic? What would be the proper way to check if the patient is empty and hide the button again?
Thanks in advance for your support!
🔄 Resultado esperado
Seleciona Paciente + Exame → botão aparece
Limpa o Paciente (X no Dropdown Search) → botão desaparece
Remove todos os Exames (limpa o Dropdown Tags) → botão desaparece
🔄 Expected Result
Select Patient + Exam → button appears
Clear the Patient (X in Dropdown Search) → button disappears
Remove all Exams (clear the Dropdown Tags) → button disappears
Hi @Pedro Vinícius ,Enclosed the button with an If widget, and checking the conditions, Patient is selected or not, and checks whether the exam list is empty or not. You can check the OML below.Hopes this helps
"It worked, but when I repeat the action a second time, selecting a patient makes the 'Create Consultation' button appear, when it should actually remain hidden."
Ok. This is because, if we are directly removes patient after selected the exams, still the exam list remains populated so we have to clear the list of Selected exams as well. You can check the below OML, and check the Paciente action.
"Thank you so much for your help! I shared the file and your solution solved exactly the problem I was facing. I really appreciate the clear explanation and the attention."