cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hofneondeion21
Level: Powered On

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

 

 

13 REPLIES 13
Super User
Super User

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

@hofneondeion21 

 

Somewhere over the course of the past few versions, this functionality failed to work.

I have several Apps (built around April) that use that syntax and work fine.  Yet creating a new app on the same list produces the error as you see.  Oddly enough, you can use the Id  -  '{ContentType}'.Id - and it works fine.

If you collect the ContentType into a collection, you and clearly see the Name and the Id, but you can still only reference the Id.

ContentType.png

Try to set the Content type to a variable, and again, you can reference the Id without a problem.  Name shows up in the "intellisense", but if you choose it, you then have an error.

 

@TopShelf-MSFT - something funky is going on here!!

 

Like I mentioned, I've used this often in App.  Those apps are working fine still.  I don't dare make any changes to them now as all of the formulas that work around the Name will fail.

_____________________________________________________________________________________
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.
hofneondeion21
Level: Powered On

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

I appreciate your feedback. I've worked around it but it would've been much easier to base my forms off of the content type that i've designated. 

 

@RandyHayes 

Super User
Super User

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

@hofneondeion21

Glad you were able to work around it.

I know in the case of the App I mentioned, the workaround would be VERY difficult as the entire app of many "moving parts" relies on those content type names.  It would have to be completely scrubbed to switch to an Id instead.

Hoping for some feedback from @TopShelf-MSFT on this.

_____________________________________________________________________________________
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.
PowerApps Staff CarlosFigueira
PowerApps Staff

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

If I understand correctly, you're using SharePoint as a data source, is that the case? If so, what is the type of the 'Content type' column in your list? Is it a choice, a lookup to another list, or something else?

Super User
Super User

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

@CarlosFigueira 

Content type is a built-in column.  When a SharePoint list has "Allow Management of Content Types" enabled, the list then contains a Content Type column automatically.  It is a hidden column.  You cannot adjust it or see it in list settings. 

For me, besides the App that is currently functioning (at an older release level) I set up a test list for testing purposes.  That list was very simple.  Created the list, set the "Allow management of content types" in the advanced settings. Added two existing site content types to the definition (in my case I chose "Official Notice" and "Message" types)

Back to the new list - created one new list item of type "Official Notice".

Then - went into PowerApps.  Connected to the list as a data source.  And did some tests:

 

1)  On a button - ClearCollect(testCT, First(myTestList))

     Viewed the collection in the collection viewer:

ContentType4.png

 

2)  On a label - First(testCT).'{ContentType}'.Name 

     This gives the red X and underlines .Name as an invalid identifier.  Name is in the table.  Name appears in the "intellisense".  But when used, it is invalid.

ContentType2.png

 

3)  Same label - changed to First(testCT).'{ContentType}'.Id

     This provides the full Id of the ContentType which is the correct content type ID in SharePoint

ContentType3.png

 

You can see in the first image of the collection, the column is there AND it has the correct information in it, yet it is invalid when used.

 

I hope that is clear and informative.

_____________________________________________________________________________________
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.
hofneondeion21
Level: Powered On

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

Yes it is from a Data Source. As you know, you can create your own content types. 

 

In the Powerapps, you can add the Content Type Data Card. I was using this particlar card to try to make visible certain data cards. For some reason though, the Identifier 'Name' isn't a valid one.

 

When I use the DataCard that is associated to the Content Type, and look at the Item control, it shows Choices(SharepointListTable.'Content type')

 

@CarlosFigueira 

 

I've managed to work a way around it though. Yet it took some trial and error. 

 

Thank you though for responding. 

 

hofneondeion21
Level: Powered On

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

@RandyHayes 

 

That is exactly what I'm having trouble with. 

 

I've managed to just use the parent.Default of that DataCard and store it's Name, which for some reason will allow if you're passing it to another field like label, and use my logic off of that.

 

Thank you for showing an extact example though. 

 

 

Super User
Super User

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

@hofneondeion21 

Interesting that you can get a valid value from the datacard parent property.

That's not an option in our case as there is no Forms or datacards involved in one particular app.

 

Definitely a bug in this case.

_____________________________________________________________________________________
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.
hofneondeion21
Level: Powered On

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

@RandyHayes 

 

I maybe explaining it wrong. But you can get the Choices Value or in this case the Name of the selected Item in the dropdown/combobox, which is just enough to get me through my logic. 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 357 members 4,303 guests
Please welcome our newest community members: