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 / Combo and Content Type
Power Apps
Answered

Combo and Content Type

(0) ShareShare
ReportReport
Posted on by 168

I have a table that pick up records in a SharePoint library. Is it possible to use the content type in a combo box to pick up the names of the content type used in the library. I have the following in the Items property which seems to have values but no display name.

 

TemplateTable.'{ContentType}'

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @Ianhall1892 , 

    According to your description, I made a test for you. 

     

    By using the formula [ TemplateTable.'Content Type'.Name ], power apps will report an error. 

    I am afraid that powerapps does not support this data type now. 

    However, If you create a collection for TemplateTable.'Content Type', the value of ‘Name’ can be seen in collection. 

    So, I suggest you create a table that records the relationship between ‘Id’ and ‘Name’

    Then use filter() function to filter the records by ‘Id’ through this relationship between ‘Id’ and ‘Name’

     

    For example: 

    1\ This is my test document library. I named it 'AABBCCDDEE'.  

    v-xiaochen-msft_0-1606362910233.png

     

     

    2\ I create a collection for the test document library. There are 2 content types in it.

    Create a button and set its onselect property to:

    ClearCollect(AAA,ForAll( Distinct(AABBCCDDEE,'Content type'.Id),LookUp(AABBCCDDEE,'Content type'.Id=Result).'Content type')) //AAA is my collection name

    v-xiaochen-msft_1-1606362910236.png

     

      //Choose file – collections .you will see this table and see their names.

     

    3\ So ,I create a relationship list for 'Id' and 'Name'. I named it 'TestA'. ‘Id’ and ‘Name’ are one to one relationship. Each record is a content type in your document library. In my test document library ‘AABBCCDDEE’, I have two content types of Items, so I created two records.

    It is worth noting that in different document libraries, the same content type of Id is different.

    If you have less than five types(<=5 😞

    3.1  Create 2 fields.’Id’ and ‘Name’

    v-xiaochen-msft_2-1606362910237.png

     

    3.2  Through my collection, I know that I have Items of content type 'Summary Task', so I input its Id and Name into the Id Field and Name Field in ‘TestA’.      // You can create a gallery to display ‘content type’ ‘s Id and copy it.

    3.3  Through my collection, I know that I have Items of content type 'Document', so I input its Id and Name into the Id Field and Name Field in ‘TestA’.

    3.4  This is my ‘TestA’

    v-xiaochen-msft_3-1606362910238.png

     

    If you have more than five types(>5 😞

    You can use LastN() function on collection. Like this:

    LastN(ClearCollect(AAA,ForAll( Distinct(AABBCCDDEE,'Content type'.Id),LookUp(AABBCCDDEE,'Content type'.Id=Result).'Content type')),5)

     

    4\ Add a combo box control 'ComboBox2' and set its Items property to:

    TestA

     

    5\ Add a gallery control and set its Items property to:

    Filter(AABBCCDDEE,'Content type'.Id=ComboBox2.Selected.Id)

    6\ The result is as follows:

    v-xiaochen-msft_4-1606362910240.png

     

    Best Regards,

    Wearsky

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard