cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

PowerApps - Help With Visible Property Based on Content Type or Text Column

I am working on a Customized Form using PowerApps for a library with multiple content types (e.g., Procedure, Reference). Not all columns are shared between content types. Thus, I have a requirement to use show just the columns for a given content type and hide those that are not shared with the other content types through the form. I was attempting to do this through the visible property.

 

Attempt 1 - Use the Content Type column (failed to work)

If(DataCardValue10.Selected.Value="Procedure",true,false)

 

Attempt 2 - Write a Flow to write the Content Type name to a text column. Use that column for the expression (failed to work):

 

If(DataCardValue19.Selected.Value="Reference",true,false)

 

OR

 

If(DataCardValue19.Text.Value="Reference",true,false)

 

Any advice on how to correct the syntax would be greatly appreciated. Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@hilowflow44 

There has existed for a long time now an issue with the names of Content Types and their values in PowerApps.

 

However, Dropdown and comboboxes seem to be immune to the issue.

If your DataCardValue10 is a Dropdown or Combobox whose default comes from Choices(yourDataSource.'Content Type') then you should be able to use the following on your visible property of the datacard you wish to hide/show:

    DataCardValue10.Selected.Name = "Procedure"

 

This will return a true or false condition (no need for the extra If statement) and will set the datacard visibility based on the content type chosen to be "Procedure"

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Super User III
Super User III

@hilowflow44 

There has existed for a long time now an issue with the names of Content Types and their values in PowerApps.

 

However, Dropdown and comboboxes seem to be immune to the issue.

If your DataCardValue10 is a Dropdown or Combobox whose default comes from Choices(yourDataSource.'Content Type') then you should be able to use the following on your visible property of the datacard you wish to hide/show:

    DataCardValue10.Selected.Name = "Procedure"

 

This will return a true or false condition (no need for the extra If statement) and will set the datacard visibility based on the content type chosen to be "Procedure"

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Yes, that solved it. Thank you so much for your help!

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 (7,081)