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 Apps
Answered

Collection

(1) ShareShare
ReportReport
Posted on by 310

I build this app-based on a SharePoint List.

Here is my list with 3 columns:

Canadiansal_0-1607664103877.png

my requirement: when the users open the records in the edit screen, they can change the Person Column. And this change will be created as a new record in the list. The original record will say intact.

On start of the App, I create a collection with this Code:

ClearCollect(
ColDemo,
ShowColumns(
Table(Defaults('Test')),
"Title",
"Column1",
"Column2"
)
);
Clear(ColDemo)

 

And on the On Select of the IconAccept on the Edit screen, I have this Code:

Collect(
ColDemo,
{
Title: txtTitle.Text,
Column1: txtColumn1.Text,
Person: txtPerson.Selected
}
)

Canadiansal_1-1607664429863.png

 

I am actually following along with a youtube video, and maybe missing a few steps here. Currently, the application does nothing - no changes are saved to the list. Where do I need to look?

 

 

Categories:
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Canadiansal 

    Rather than to worry about all those intermediary Collections, instead just

    1) add the SharePoint List as a data source directly in your Canvas App, then

    2) add a single Button Control to the app and finally

    3) simply add this formula below in your OnSelect property of that Button:

     

     

    Patch(TitleColumnPersonList,LookUp(TitleColumnPersonList,Title = "Test1"),{Person:TextInput1.Text})

     

     

     

    and that is all. See if this works better for you.

     

    The response above is presuming the following:

     

    SharePoint List called TitleColumnPersonList (use the name of your SharePoint List instead).

     

    tcp-shplist0925.png

     

    Tested by us - actual result in SharePoint List after the button is clicked in Canvas App:

     

    tcp-shplist0925-result.png

      Notice - that only Person column was changed of only that first  row / record!

    See it in action below as well:

    TitleColumn1PersonApp009-a1.gif

     

    The example above also presumes:

     

    One Text Input control called TextInput1 for the TextInput1.Text part of the Patch formula. This can just be something else entirely in your case, obviously - you can even just hard code a string value there instead first when practicing.

     

    The Gallery1 being there and hooked to the SharePoint List data source in the visual example above is not presumed or required - it is only there to show it visually in action and that it is working to Patch only the one column in the one record from SharePoint List. 

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     

    PS: Just noticed you meant to create new record based on original record. So do it like this instead for that way:

     

    Screen1 OnVisible:

    Set(_BaseRecord,LookUp(TitleColumnPersonList,Title = "Test1"))

    In this simple example we set one record to the variable on screen visible. You could easily instead adapt this example and Set that variable from another trigger, such as to select a specific record instead from a Gallery, and use the Lookup accordingly there in that property.

     

    Button1 Patch:

    Patch(TitleColumnPersonList
    ,
     {Title: _BaseRecord.Title, Column1: _BaseRecord.Column1, Person: TextInput1.Text}
    )

     

     

    Version in action that we think you really wanted:

     

    TitleColumn1PersonApp009-a2.gif

     

     

     

    Check if the above helps you @Canadiansal .

     

  • Canadiansal Profile Picture
    310 on at

    Thank you. This is very helpful!

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard