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 / Submit record to Share...
Power Apps
Unanswered

Submit record to SharePoint list with ContentType

(0) ShareShare
ReportReport
Posted on by

I have a problem which i thought was going to be simple to fix at first but after a couple of attempts to gain the desired result I am still stumped. I am just trying to submit an item to a sharepoint list with a variable definition of the content type. 

Currently I have a global variable which stores the content type dependant on a user selection on the previous page and it is stored like so. 

Set(contenttype,{Id:"0x01000....", Name:"A"})

I have then tried to collect some information from a form to send it to the list. 

Collect(Audit, 
{
 '{ContentType}': contenttype,
 System: DataCardValue27.Selected,
 Date: Today(),
 Title: DataCardValue18.Text,
 Auditors: DataCardValue23.SelectedItems,
 Attendees: DataCardValue24.SelectedItems
});

I have also tried to set the content type as if it was a lookup column but this still didnt work.

Collect (Audit,
{
'{ContentType}':{'@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:contenttype.Id, Name:contenttype.Name}
....
})

(It works fine with the default content type if i delete the content type line) 

I have also tried to set a default property of the content type data card to the variable but this returns an error "A value must be provided for item".

Is this possible or should I post this request to the powerapps ideas?

 

Edit: I have been playing about with a control that I have linked to the '{ContentType}' column and i have locally collected what the selected control submits and the value I have been trying to patch to the list and they are both identical. I have also tried setting the default of this control (as you would for a lookup column) but it will be ignored so i am going to assume that this is a limitation.

Categories:
I have the same question (0)
  • Sienna Profile Picture
    1,532 on at
    Have you thought about simply not to use datacards whatsoever. Patching a database with variables is a common thing without datacards forms and other useless things in powerapps.
  • Community Power Platform Member Profile Picture
    on at

    I have tried to add the controls without datacards but the same thing happens, it will work without the ContentType declaration so:  

     

    Patch([list], {ID:Blank(), Title:"textinput1.text"})

     would work with the default content type of the list however

    Patch([list], {ID:Blank(), '{ContentType}':variable, Title:"textinput1.text"})

    would not work and it would return the error "value required for item". 

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard