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 / Copying values an item...
Power Apps
Answered

Copying values an item, but keep incrementing a value +1

(0) ShareShare
ReportReport
Posted on by 48

Hi everyone,

 

We are building an app containing a form (based on a SharePoint list) which has about 11 datacardvalues.

 

One of those values (called 'AW') isn't available to edit and is a number value, incrementing by one everytime a new item is added in the SharePoint list. However, our app should also be able to copy items from that list (keeping all the other values), but still incrementing 'AW' by one. Thus, all values should be copied, except that one value, which still needs to change accordingly.

 

The code in 'Default' for 'AW' is: If(Form1.Mode=FormMode.New;Last('Listname').AW+1;Parent.Default), which works fine. The code in 'OnSelect' for our copy button is: Patch('Listname';Form1.Updates);;Navigate(HomeScreen). That does work, it copies everything, but it also copies the 'original' AW-number, which isn't correct, because it should be added +1 based on the last item that was added.

 

Any ideas on how to achieve this? Thanks in advance!

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    HI @AB_ ,

     

    The idea behind the below is to use a patch to increment AW right after the copied item is created:

     

    Patch(
    	'Listname';
    	Form1.Updates
    );;
    Patch(
    	'Listname';
    	Last(ListName),
    	{AW:Form1.Updates.AW+1}
    );;
    Navigate(HomeScreen)

     

     

    On a different note, why not use the ID column, since that is automatically incremented?

  • AB-18111337-0 Profile Picture
    48 on at

    Thanks for your reply! It works!

     

    And the reason why we don't use ID is that the number starts at 3780. Except if you also have a solution for that.

     

     

  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @AB_ ,

     

    Glad to see this is now working for you.

     

    The only way to "reset" the ID column is by replacing the existing list with a new one, however that seems overkill.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard