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 Platform Community / Forums / Power Apps / Forms: Logic to Hide F...
Power Apps
Answered

Forms: Logic to Hide Fields Based on Other Field Value Not Working

(0) ShareShare
ReportReport
Posted on by 222

I hope someone can help me. I have scoured the web and found what I thought was the solution, but I get an error message. The first question on my form asks if this is Account Type A or Account Type B. I experimented with both choice fields and yes/no toggle and opted for y/n. My flow works just fine with this option, but I can retool it if I need a choice field to make my form work.

I have 2 types of accounts: Account A or Account B. Account B also has 2 program types, B Program 1 and B Program 2. The fields the user needs to fill out vary depending on the selection:

FieldColumn (click to edit)Account AAccount B Program 1Account B Program 2
1What Type of Account?X  
2A Account NumberX  
3A Program TypeX  
4B Account Number XX
5B Account Name XX
6B Program Type XX
7Launch DateXXX
8User Invitation DateXXX
9Rep NameXXX
10Sales LeadX  
11Group NameXXX
12On Call ExpertsXXX
13UsersXX 
14NotesXXX

 

This should be a simple matter of applying logic to a field that if the selection in question 1 is true, make fields 4, 5, and 6 not visible and so on. The formula I found is this:

If(DataCardValue1 = ExpectedValue, true, false)

When I use this formula, I get an error that the formula uses scope, which is not presently supported for evaluation:

 

1.png

 

2.png

 

I figured maybe it was just a problem with the y/n, so I changed it to a choice field. Same thing:

 

3.png

 

4.png

 

Why isn't this working? What do these errors mean? If I was using Nintex or even InfoPath, I'd have been done by now.

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @ACPBSCi 
    I think you are close to the solution: you are just missing the Text property of the DataCardValue control.

     

    If(DataCardValue1.Text = ExpectedValue, true, false)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • eka24 Profile Picture
    20,923 on at

    Take this example DatacaraValue1 and DatacaraValue2.

    If you want to hide Datacard for DatacaraValue1  based on what is in DatacaraValue2 then:

     

    Visible of DatacaraValue1 put:

    If(DataCardValue2.Text = "ExpectedValue", true, false)

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • ACPBSCi Profile Picture
    222 on at

    Hmm...still not working...

    So rather than use the control, I need to use the name of the datacard?

     

    5.png

     

     

     

     

     

     

     

     

     

    Is that true for all formulas?

    I am definitely getting closer. I finally got a formula with no error, but I had to use SearchText because it gave me an error when I typed in just "Text":

    If(DataCardValue13.SearchText="A",true,false)

    However, my card is permanently hidden and it doesn't do anything based on my selection. Why is .Text available for everyone else and not me? It's a text choice field that my show/hide is based off of.

  • Verified answer
    eka24 Profile Picture
    20,923 on at

    Change it to:
    If(DataCardValue13.Selected.Value="A",true,false)

    or

    If(DataCardValue13.Selected="A",true,false)

     

    If it does not work, select DataCardValue13 and take a screen shot, want to see what you put in the ITEMS

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @ACPBSCi 
    DataCardValue13 is a ComboBox control.  This is why my previous suggest did not work.  I assumed you were using a TextInput control.

     

    You'll want to use this code instead.

    If(DataCardValue1.Selected.Value = ExpectedValue, true, false)

     

    If there is no property called Value you can use a different column name

    If(DataCardValue1.Selected.your_column_name= ExpectedValue, true, false)

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • ACPBSCi Profile Picture
    222 on at

    THANK YOU!!!!

    Ugh, this is so confusing! I wish Forms were more intuitive. This is like laying pipe. No, I take that back. Laying pipe is easier. Working with forms used to be easy, now it's really hard.

    Thank you so much!!

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard