Forum Discussion
Power Apps Patch Command with specific Content Type
Dear Ladies and Gentlemen,
how can I create in Power Apps Patch Command to create a new item in a SharePoint Online list with specific Content Type?
Thank you for your answer.
With best regards
Ladislav Stupak
Thank you Jamony,
Copilot helped me to get the right command.
Patch('List Name';
{
LookupColumn1:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedLookup";
Id: LookupColumn1Id;
Value: LookupColumn1Title};
LookupColumn2:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedLookup";
Id: LookupColumn2Id;
Value: LookupColumn2Title};
Inhaltstyp: LookUp(Choices('List Name'.Inhaltstyp); Name = ContentTypeName)});;
2 Replies
Hi LadislavStupak, I’d use the content type ID rather than the display name. If your SharePoint connector exposes ContentTypeId, you can include that in the Patch when creating the item; if Power Apps hides that system field, the reliable workaround is to create the item first and then call a small Power Automate flow or SharePoint REST update to set the item’s ContentTypeId.
- LadislavStupakIron Contributor
Thank you Jamony,
Copilot helped me to get the right command.
Patch('List Name';
{
LookupColumn1:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedLookup";
Id: LookupColumn1Id;
Value: LookupColumn1Title};
LookupColumn2:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedLookup";
Id: LookupColumn2Id;
Value: LookupColumn2Title};
Inhaltstyp: LookUp(Choices('List Name'.Inhaltstyp); Name = ContentTypeName)});;