web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapp Formula error...
Power Apps
Unanswered

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

(3) ShareShare
ReportReport
Posted on by 27

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

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

     

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

  • hofneondeion21 Profile Picture
    27 on at

    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 

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @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 @Anonymous on this.

  • CarlosFigueira Profile Picture
    on at

    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?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

  • hofneondeion21 Profile Picture
    27 on at

    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 Profile Picture
    27 on at

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

     

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

  • hofneondeion21 Profile Picture
    27 on at

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

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard