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

Powerapp Formula error for 'Content type'.Name - Invalid Identifier

So have combobox list of Content types, Pouch, Sidewell, Rollstock, etc. I want to access the name of each content type. I'm trying to use it as a paramter in the function Lower. i.e ==> Lower('Content type'.Name). 

 

Yet when I do, the 'Content type' identifier Name isn't valid. I've seen other videos of it being valid. I'm not entirely sure how to make it valid. 

 

I got the idea from this video --> https://www.youtube.com/watch?v=RPITzpPlbiQ&t=1230s and if you go to 28:41 in the video you'll see how she uses it and its formula. I've tried to mimic her formula and placement of the example yet I've gotten no luck. 

 

Any help or explanation as to what i'm doing wrong would be great! Thank you in advance!!

 

 

19 REPLIES 19
Highlighted

@hofneondeion21 

Yes, the use of Choices from the ContentType does work and allows you to access the Name column.

The problem in our case is we need to get to the ContentType.Name on each record for a comparison for many other things that go on in the app.  

Not that we couldn't change the logic to try and collect those types ahead of time with the Choices function or do lookups with the ID's to get to the names (which would work fine), it's just that, for this one app...that represents a boat load of work.

AND...this is still something that needs to be fixed.  It did work once and it appears to be there, but something else is preventing it from now working properly.

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

@RandyHayes 

@CarlosFigueira 

 

Thank you for you prompt responses! 

Highlighted

Thanks @hofneondeion21 and @RandyHayes for the explanation. Yes, this is a bug in PowerApps. I've filed it against the appropriate team.

Highlighted

@CarlosFigueira 

Thanks for the follow-up.

_____________________________________________________________________________________
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!
Highlighted
Impactful Individual
Impactful Individual

This issue still exists.

 

Any workarounds seem to be not delegable either, which in my case makes it useless.

 

You can't create a calculated column in SharePoint from the Content Type name, but you can use Flow to trigger when a new file is created to populate a string column with the content type name and then filter that in PowerApps, but man alive what a hacky workaround. The flow needs loads of retry logic built in because you can't update the file properties of an open file (even though two people can simultaneously work on the same document).

Highlighted

Data is not refresh when we use the SharepointIntegration.{ContentType}.ID

Highlighted

@CarlosFigueira  I've just encountered this bug myself, and there appears to be no usable workaround. I can't use Id instead as that isn't delegable for some reason. May we have an update from the relevant team, please?

Highlighted
Impactful Individual
Impactful Individual

I ended up working around this by creating a bunch of site columns for each of the content types I wanted to filter by. They are string columns with a default value of "Yes" and a name like IsProjectDocSet. In the content type settings (in this case a Document Set content type called Projects), I add the column without allowing child documents to inherit it, and in the Power App, Filter(Documents, IsProjectDocSet = "Yes") and that filters only my Projects document sets, and it's delegable, which is the important thing with document libraries because you almost always have over 2000 files.

Highlighted

That's an interesting workaround, thanks for sharing @WillPage.

 

It's mad that such a hack would be needed, though; having to create extra site columns and duplicate data already present in the system, just to deal with a regression bug, is absurd.

Highlighted
Regular Visitor

Maybe this isn't quite the same issue with that particular error Message.

 

The problem I had is that the default controls in a TemplateGalleryList are labels.  Labels are apparently not able to handle the complex field type (Id, Name); it seems to only be able to use the first sub-field.

 

A solution to this is to add a combo box instead - make sure to add it in the item template. 

 

In the Combo Box Properties:

  • Set the DataSource to fx=Choices(YourListName.'Content type')
  • Set the Display Mode to 'View'
  • Set the Default Selected Items to ThisItem.'Content type'
  • Data Layout: Set Primary Field to Name and Search Field to Id (not sure if this part is necessary, the search isn't showing in Display Mode: View)

Done.

 

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 (9,695)