Home Blog Assign PowerApp canvas form for a new item creation in SharePoint Online

Assign PowerApp canvas form for a new item creation in SharePoint Online

Alex Pollard 31 Jul 2023

Visit our website to find out more useful solutions and services from Chiron IT https://chironit.com

There are two types of PowerApps: Form and Canvas. If you just modified the list item view form you will see a lot of limitations on available functionality. So, you might want to create a Canvas app instead.

If you created the Canvas type PowerApp it will always be opened from the PowerApp site. What if you want your users to a user that PowerApp when they click on the New Item or Edit buttons in the list from SharePoint Online?

You can use the PowerShell script provided below and it will make a trick.

Pre-requisitions:

  • You need to have at least site collection admin permissions
  • Run PowerShell ISE with admin privileges on your local machine- Install pnp

Install Module SharePointPnPPowerShellOnline

The script itself is here

Connect-PnPOnline -url https://CONTOSO.sharepoint.com/sites/

dev -UseWebLogin

$list = Get-PnPList “EUTX Architecture Services

write-host $list.Name

$contenttypes= Get-PnPContentType -List “EUTX Architecture Services

foreach($cc in $contenttypes)

{

Write-Host $cc.Name

If ($cc.Name -eq “Item”){

$cc.EditFormUrl = “SitePages/ItemEditForm.aspx”

$cc.NewFormUrl = “SitePages/ItemEditForm.aspx”

$cc.Update($false)

}

}

# assuming list content type 0 == Item

# otherwise, you need to set this on the correct list content type

# no update child content types

# you may have to set $true if you have content types in your list

$context = Get-PnPContext

$context.ExecuteQuery()

Leave a Reply

Your email address will not be published. Required fields are marked *

Thank you for your comment

Your comment has been successfully submitted and will be published immediately after moderation.

Have a great day!

Have questions?

    Contact me

    Thank you for reaching out!

    Your message has been successfully delivered. I will be in touch with you shortly to discuss your inquiry further.

    If you have any urgent matters or need immediate assistance, please don't hesitate to contact me directly at my email or phone. I look forward to connecting with you and assisting you with your needs.

    Have a great day!
    Contact Information
    cookies
    This website uses cookies

    This website uses cookies. By continuing, I assume your permission to deploy cookies as detailed in the Privacy Policy.