web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

Desabilitar botao

(0) ShareShare
ReportReport
Posted on by 98

Olá,

 

Como faço para desabilitar o botão de salvar se algum campo do formulário estiver em vazio?

 

Obrigado.

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hi,

     

    You can set the DisplayMode property of the Button to

    If ( IsBlank ( DataCardValueXX.Text) || IsBlank(DataCardValueYY.Text), DisplayMode.Disabled, DisplayMode.Edit))

     

    Then add more checks with

    || IsBlank(otherDataCard.Text)

     

    Could you please give that a try and let me know how you get on,

     

    Thanks!

    ManCat

  • FabioBarbosa Profile Picture
    98 on at

    Oi @iAm_ManCat ,

     

    Deu certo com os campos texto e número.

     

    Tenho um campo que esta criado na lista do sharepoint como Opção e também um campo anexo. Para estes dois, tentei deixar apenas || IsBlank(DataCardValueXX) <sem o .Text> mas não deu certo.

     

    Como faço para que eles também façam parte da regra que se estiverem vazios, não habilita o botão?

  • FabioBarbosa Profile Picture
    98 on at

    @iAm_ManCat consegui fazer para o campo de opção. Não estou conseguindo para o campo Anexo.

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hi @FabioBarbosa 

     

    Glad to hear that you resolved the Option item, for the attachments you will need to count the number rows of attachment items (as it is a table of items) like this:

     

    If(
       /////// Previous Code for checks ////////
       &&
       (CountRows(DataCardValue4.Attachments)=0),
       // Actions if empty

       ,
       // Submit Action

    )

     

    Cheers,

    ManCat

  • FabioBarbosa Profile Picture
    98 on at

    Olá @iAm_ManCat.

     

    Para desabilitar o botão enviar se não tiver nenhum anexo, criei o comando abaixo na propriedade DisplayMode do Botão mas não deu certo.

     

    Tentei seguir como me passou mas não consegui também.

     

    If (IsBlank (DataCardValue22.Attachments);
    (CountRows (DataCardValue22.Attachments) = 0)) &
    DisplayMode.Disabled &
    DisplayMode.Edit 

  • Verified answer
    iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hi @FabioBarbosa 

     

    You should be able to resolve the script issue with this: 

     

    If(
        (CountRows (DataCardValue22.Attachments) = 0));
        DisplayMode.Disabled;
        DisplayMode.Edit
    )

     

    Could you let me know if that works?

     

    Thanks,

    Sancho 

  • FabioBarbosa Profile Picture
    98 on at

    Olá @iAm_ManCat ,

     

    Deu certo.

     

    Agradeço pelo apoio.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard