Await doesn't work as expected

I tried several versions of it but whatever I do, the if statement gets executed before the query is finished. Any help would be highly appreciated! :slight_smile:

Hey @Robert84,

Try with this syntax:

text_form_error.setHidden(true);
variable_global_password_entry.setValue(input_password.value);

// Trigger the query and handle success
query_global_select_assembler.trigger({
  onSuccess: (data) => {
    if (data?.id?.length === 1) {
      // Query returned the expected result
    } else {
      text_form_error.setHidden(false);
    }
  }
});

thank you very much. I tried something similar but that didn't work neither. Yours did.

1 Like