Skip to main content

Notifications

Community site session details
Power Apps - Building Power Apps
Answered

Program Power Apps Form Button to create new SharePoint list item

Like (1) ShareShare
ReportReport
Posted on 8 Jan 2020 22:56:49 by 13

I'm new to Power Apps so I need some assistance with a task that may be very simple.  I have created a form for a SharePoint list that includes a DataTable that is populated with items from a second SharePoint list.  I would like to add a button that can be used to add items to the second SharePoint list.  The form looks something like this:

 

Screen Shot 1.jpg

 

The lower part of the form is the DataTable that is populated with items from the second SharePoint list.  I would like the "Add Item" button to open up a form for creating a new item in the second SharePoint list.

 

I assume that the correct place to add the code is the OnSelect field in the ACTION section for the button.  I'm just getting stuck finding the correct code.

 

Thanks for your help!

 

Screen Shot 2.jpg

  • MI2022 Profile Picture
    52 on 20 Apr 2022 at 16:54:40
    Re: Program Power Apps Form Button to create new SharePoint list item

    Hi @Kjell how did you insert the DataTable populated with items from the second SharePoint list?

    I'd like to have the same solution but on the same SharePoint list and filtered.

    Thank you very much.

  • Kjell Profile Picture
    13 on 10 Jan 2020 at 19:49:00
    Re: Program Power Apps Form Button to create new SharePoint list item

    Hi Sik,

     

    Thanks for your reply.  This does indeed open up the form that I'm looking for.

  • Kjell Profile Picture
    13 on 10 Jan 2020 at 19:46:53
    Re: Program Power Apps Form Button to create new SharePoint list item

    Hi Paul,

     

    Thanks for your reply.  It may not be exactly was I was looking for since I wanted to display the form for creating a new item.  I may have to create items this way as well though so your suggestion is very much appreciated.

  • Verified answer
    v-siky-msft Profile Picture
    on 09 Jan 2020 at 09:45:30
    Re: Program Power Apps Form Button to create new SharePoint list item

    @Kjell

    What does it mean when you said: "open up a form for creating a new item in the second SharePoint list"?

    If you mean to open a New Item page from SharePoint,  you can use Launch() function to open it, set the OnSelect of button as below:

    Launch("https://<Domain>.sharepoint.com/sites/<SiteName>/Lists/<ListName>/NewForm.aspx")

    Note: modify the URL to your own New item page.

    StoG_19.gif

    Sik

  • PaulD1 Profile Picture
    2,914 on 09 Jan 2020 at 00:29:44
    Re: Program Power Apps Form Button to create new SharePoint list item

    You'll want to use the Patch function:

    Patch([SharePointList], Defaults(SharePointList),
    {Field1: Value1,
    FIeld2, Value2,
    ...
    })

    SharePointList is the list you are patching (inserting) into.

    Field1 is the name of a field in that list - Value1 is the value you want to set it to. If the Field is PartNumber and the value you want to insert into it is in a label called lblPartNumber then it would be like this:

    {PartNumber: lblPartNumber.Text}

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 44 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard