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 Platform Community / Forums / Power Apps / power apps Copy existi...
Power Apps
Answered

power apps Copy existing item and submit as new item on SharePoint

(0) ShareShare
ReportReport
Posted on by 100

Hi,

 

We have created Canvas app user can submit new item to sharepoint list, is it any way user can get existing item and submit as new item on SharePoint?

Categories:
  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi @hong_yip ,

    You can use the Patch() function, but you probably want to strip out all the SPO auto-generated or system columns from the source record first - you can do this by using ShowColumns() or DropColumns(), depending which involves the least number of columns you want to specfy.  (ShowColumns if you have more you want to drop than show, DropColumns if you have more you want to show than drop).  

    The first question is which row of data do you want to copy - so this needs to be from some sort of selection or lookup. 

    ShowColumns() expects a table input, so instead of a lookup, we want to get our row into Table format. One way of doing this is using the Table() function - there's only one row in our result, but the data construct returned is a Table, so we can use ShowColumns() on it.  We then use First() on that to get back to a record construct.

    For example, let's say you have "FirstName", "Surname" and "Email" columns in a SPO list. 

    If you're displaying a gallery of all your SPO items, try adding a button to the page and set it's OnSelect: property to;

     

     

     

    //Convert selected record into a table using Table() so we can then use ShowColumns() to strip everything that's unnecessary, then use First() to get back to a record
    //Assumption is your Gallery Items: property is SPOList, otherwise instead of using Gallery.Selected, use a lookup on SPOList to find the correct record
    
    With({ 
     copyRecord: First(ShowColumns(Table(Gallery.Selected), 
     "FirstName", 
     "Surname", 
     "Email"))
     },
     Patch(SPOList, Defaults(SPOList), copyRecord)
    )

     

     

     

     Hope this helps,

    RT

  • Verified answer
    WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @hong_yip ,

    Three ways I can think of - one set a Variable for the current record

    Set(varRecord,ThisItem)

    You would have to run this from inside a gallery or form for ThisItem to register.
    Then a new form with each field Default set to the relevant field name

    varRecord.YourFieldName

    The others would be to set the same Variable and then use Patch

    Patch(
     ListName,
     Defaults(ListName),
     {
     Field1:varRecord.Field1,
     . . . . . . .
     }
    )

    You could also use Collect

    With(
     {
     wItem:
     DropColumns(
     varRecord,
     "ID"
     )
     },
     Collect(
     YourListName,
     wItem
     )
    )
    

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • hong_yip Profile Picture
    100 on at

    Thx WarrenBelz and RusselThomas reply 

    i am explain not enough, a user may be need to getting existing item and modify item then submit as new item on SharePoint.is it possible?

  • RusselThomas Profile Picture
    4,014 on at

    Hi @hong_yip ,

    Assuming you're using a gallery to 'select' the record you want to edit and duplicate, you can add an Edit form and set it's default mode to "New" and call it copyForm.

    Then you would need to unlock and edit each of the cards in the form and set their "Default" property to the corresponding field in the record using Gallery.Selected.Fieldname 

    Once you've done this for all the cards, this will allow the user to see the current values for the selected record, and they can change/edit any of the ones they could with an Edit form.

    You can then add a button and set it's OnSelect: property to SubmitForm(copyForm) and it will create a new record.

    Hope this helps,

    RT  

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @hong_yip ,

    As per my post and I see there is also one from @RusselThomas , I gave you three options and Russel gave you a few more, so yes, it is possible using one of those methods.

  • DublinOH_User Profile Picture
    150 on at

    @RusselThomas 
    Hello:
    May I please ask for a brief explanation?
    In this line:

    copyRecord: First(ShowColumns(Table(Gallery.Selected),

     Is 'Table' a function call or should that be the name of the SharePoint List ?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard