cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted

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

Highlighted

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

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

Highlighted
Super User III
Super User III

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.

Highlighted

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.

Highlighted

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

Highlighted

@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

Highlighted
Helper II
Helper II

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (2,387)