cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
matt1405
Helper I
Helper I

Problem with hiding some data cards on a form

Hi 

I'm trying to hide of make visible form fields based on an option set choice. 

Data Card 9 is the option set I want to set other fields visible property against with an option set choice of "Scan" or "Destroy". 

I've tried this formula  

If(DataCardValue9.Selected.Value = "Destroy",true,false) 

 

However I get formula errors saying:

"Incompatible Type. We can't evaluate your formula because the values compared in the formula aren't the same type"

 

How do I resolve this?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @matt1405 

 

Instead of Choice('Scan or Destroy') give this ["Scan","Destroy"] then put the visible property to Datacard9.selected.value = "Destroy"

View solution in original post

7 REPLIES 7
Krishna98
Helper V
Helper V

Hi @matt1405 ,

 

is the datacardvalue9 is of dropdown with items string type or else it is any other type? 

if it is dropdown with string type you can set the visible property as datacardvalue9.selected.value = "destroy" this will be enough no need of if condition.

rimiac
Regular Visitor

Hello,

 

The issue is that you are trying to compare 2 different types of data, try :

 

If(DataCardValue9.text = "Destroy",true,false) 

 

If you are talking about dropdown, then "selected.value" should work!

Thanks @rimiac and @Krishna98 

I tried If(DataCardValue9.Selected.Value = "Destroy", true,false) and still get the same result. 

Both the DataCardValue9 and the Data Card I'm tying to hide are option sets, could that have an effect?

@matt1405 Can you please add the screenshot of your option set control to your question? Also, what type of data is stored in option set?

This information will help us to answer your question correctly.


Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it 👍

 

Hi @ganeshsanap 

 

matt1405_0-1603104065645.png

matt1405_1-1603104352544.png

I want to hide some fields based on he choice of scan or destroy. 

Number of files is a numeric field but the same issue appeared with a different field showing an option set showing choices 1-50.

 

Any ideas?

Hi @matt1405 

 

Instead of Choice('Scan or Destroy') give this ["Scan","Destroy"] then put the visible property to Datacard9.selected.value = "Destroy"

View solution in original post

Thanks @Krishna98  that's fixed it. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,027)