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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ERROR IN "IF" CONDITION
Power Apps
Unanswered

ERROR IN "IF" CONDITION

(0) ShareShare
ReportReport
Posted on by

I have to leave the property of a "disabled" button depending on the condition of some fields, but in my last condition, the same does not acknowledge the condition imposed...

 

Here my screens to explain better:

 

 

Here I have a field of choice where the user can choose between: "without estimate" (sem estimativa) and "there is ...."

erro1.png

 

 

Here we have two fields of "Person or Group" where he compares the emails and checks if they are the same ...

erro2.png

 


Here is the "error" and I can't find it:

 

There are three conditions, the last one, where he compares the field and the fields if they are the same it doesn't work, I don't know why ...

 

The code:

 

If(
 IsBlank(DataCardValue163_6.Text) && radioFilho_1.Selected.Value = "há previsão orçamentária na área solicitante" || Value(DataCardValue163_6.Text) = 0;
 DisplayMode.Disabled;
 If(
 radioFilho_1.Selected.Value = "há previsão orçamentária na área solicitante" && DataCardValue1_3.Selected.Email = DataCardValue2_3.Selected.Email;
 DisplayMode.Disabled;
 If(
 DataCardValue5.Selected.Value = "sem estimativa" && DataCardValue1_3.Selected.Email = DataCardValue2_3.Selected.Email;
 DisplayMode.Disabled;
 DisplayMode.Edit
 )
 )
)

 

 

Here I am also showing the field names so I don't have an error ...

erro3.png

 

 

erro4.png

Categories:
  • Gorilla_8 Profile Picture
    on at

    So....Someone???

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Gorilla_8 ,

     

    As per you mentioned that the choice field with values of “sem estimativa” and “há previsão orçamentária na área solicitante”, I think there are mistakes in your formula that the name of the combo box are not proper:

     

    radioFilho_1.Selected.Value = "há previsão orçamentária na área solicitante"

    &

    DataCardValue5.Selected.Value = "sem estimativa"

     

    I suspect that one of radioFilho_1 or DataCardValue5 is the proper name of the combo box, please check if it caused the problem.

     

    Also, you could add a Label and test the results returned by each condition in the formula and check which condition is not correct.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Gorilla_8 Profile Picture
    on at

    @v-jefferni 

     

    I added the labels well before doing this pos, because this is a simple If or else condition...

     

    And if I just put this condition apart from the rest, it works, but when I put several codes together, it doesn't work.

     

    And I also checked the names of the fields, to use the correct ones, and even then it won't (when I put it in a code with several conditions)

     

    Very strange

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Gorilla_8 ,

     

    So I looked back in your code and found that your code equals to:

    If(
    IsBlank(DataCardValue163_6.Text) && (radioFilho_1.Selected.Value = "há previsão orçamentária na área solicitante" || radioFilho_1.Selected.Value ="sem estimativa") && DataCardValue1_3.Selected.Email = DataCardValue2_3.Selected.Email || Value(DataCardValue163_6.Text) = 0;
    DisplayMode.Disabled;
    DisplayMode.Edit
    )

    which I believe is not correct.

     

    Could you please explain in which condition you would like the button be disabled? IMO, it is supposed to be like below:

    If(
    IsBlank(DataCardValue163_6.Text) || IsBlank(radioFilho_1.Selected.Value) || DataCardValue1_3.Selected.Email = DataCardValue2_3.Selected.Email || Value(DataCardValue163_6.Text) = 0;
    DisplayMode.Disabled;
    DisplayMode.Edit
    )

     

    So when DataCardValue163_6( TextInput) or radioFilho_1( ComboBox) is blank or DataCardValue163_6 = 0 or 2 email addresses of selected persons in the two combo boxes are the same the button is disabled.

     

    Maybe I'm wrong with the condition, however I suppose the conditions would be more simpler than those in your current codes. Please make it clear and try more. Or you could share more details about your scenario and that would be much helpful.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Gorilla_8 Profile Picture
    on at

    @v-jefferni 

     

    because there are 5 conditions to disable the button...and involves 5 fields...

     

    When the field (s):

     

    DataCardValue165_6 is blank 

    AND/OR 

    radioFilho_1.Selected.Value = "há previsão...."

    AND/OR 

    Value(DataCardValue163_6.Text) = 0

    AND/OR 

    DataCardValue1_3.Selected.Email = DataCardValue2_3.Selected.Email

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard