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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Column name with {} in...
Power Apps
Answered

Column name with {} in collection

(1) ShareShare
ReportReport
Posted on by 9

Hello, I have a collection with a column named "{ContentType}", how can I insert this column into the "Collect()" function or ignore this column ?

 

I already test that : "{ContentType}", \{ContentType\} and '{ContentType}', but no one of this worked.

 

Thanks for all idea

 

Daniel

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi baltenspda,

     

    When using the Collect() function, you should specify a data source that you want to add data to, then the records to add to the data source.

     

    If you want to insert a column name “ContentType” to your data source, you could try to add a button and set its OnSelect property using the Collect function looks like below:
    Collect(DataSourceName,{Name:”test”,ContentType:”AA”}).

     

    For more details, please see this doc about Collect function for more details:
    https://powerapps.microsoft.com/en-us/tutorials/function-clear-collect-clearcollect/

     

    Please feel free reply if you need more help.

     

    Best regards,
    Mabel Mao

  • baltenspda Profile Picture
    9 on at

    But, in your solution, the column name is "ContentType", in mine, the name is "{ContentType}", including the "{}", like the capture :

    ContenttYPE.PNG

    So, Collect(DataSourceName,{Name:”test”,ContentType:”AA”}) doesn't work because "ContentType" doesn't exist, but Collect(DataSourceName,{Name:”test”,{ContentType}:”AA”}) dowsn't work either because "{ContentType}" is not considered like a field.

     

    This field was created when I transfer the data from SharePoint to the collection using SaveData() and LoadData().

  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi baltenspda,

     

    Please try to add a single quote on {ContentType}. The code would be looks like:
    Collect(DataSourceName,{Name:"test",'{ContentType}':"AA"})

    4.PNG

     

    Hope this will work for you.

     

    Best regards,
    Mabel Mao

  • baltenspda Profile Picture
    9 on at

    Tanks, it was working

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard