cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ACPBSCi
Resolver I
Resolver I

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

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.

2 ACCEPTED SOLUTIONS

Accepted Solutions

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.

View solution in original post

@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."

View solution in original post

6 REPLIES 6
mdevaney
Super User
Super User

@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
Super User
Super User

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.

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.

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.

@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
Resolver I
Resolver I

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!!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,555)