web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to display an item...
Power Apps
Unanswered

How to display an item from the most recent previous entry in the edit screen for new entries

(0) ShareShare
ReportReport
Posted on by 54

Hello,

 

I've made a powerapp from what was originally an excel spreadsheet through sharepoint lists.

My Title column is being used for unique ID numbers ex. P100075

 

When someone tries to add a new entry in the powerapp, is there a way to show the most recent ID number from the previous entry? Essencially I need the user to be able to type in the ID number manually. To do this they need to know the ID number of  the most recent new entry. They need to see the number that was entered in last so it isn't duplicated. I want to add a label in the new form screen for this. 

 

Since the new form screen stems from the edit screen, I don't know how I would go about fiddling with the new form screen. Any help is appreciated.


Thank you

Categories:
I have the same question (0)
  • hpkeong Profile Picture
    2,944 on at

    Hi

     

    If your Title Column is a Unique ID, e.g.: P100075, may I assume that it is the MAX No?

    If so, then you can use Max(Title) and display in a Label.

     

    Hoep this helps.

     

    TQ

  • Community Power Platform Member Profile Picture
    on at

    Hi @rowlinx

     

    I believe a way of getting the last ID from the list is to sort the list in descending order by the Title column and get the first value returned.

    As you said you would show it in a label then your label text formula would be:

    First(SortByColumns(YourListName, "Title", Descending).Title).Title

    I haven't used the default new/edit form myself, but I think that you can show/hide this label control based on the form state.

    So you can set the visible property of the label to be:

    If(Form1.Mode.New > 0, true, false)

    Hope this helps 🙂 

  • v-micsh-msft Profile Picture
    on at

    Hi @rowlinx,

     

    If the Title field here is a string type, then use the idea posted by @Anonymous should work.

    The formula might need to change a little:

    For example, under the Editform control, with the Title Field DataCard, unlock it, then add a Label control, 

    We could change its Text property with the formula below:

    "Start after: " & First(Sort(Testing,Text2,Descending)).Text2

    And if you would like it to display only when adding new record, change its Visible property with the formula below:

    If(EditForm1.Mode=New,true,false)

    See:

    125.PNG

    Data reference:

    126.PNG

     

    Some additional thoughts.

    If your App would be used by multiple users, then there might be conflicts happened when multiples users submit new records.

    A better workaround is to configure an automatic number row from the datasource side.

     

    Regards,

    Michael

  • rowlinx Profile Picture
    54 on at

    This is perfect for what I was asking. But you are right. There is conflicts with multiple users accessing this which is going to be happening often. The situation has changed now where there is no longer a P and the user no longer has a reason to edit the number. So I need an automatic number row from the datasource side as you said. However if 2 people are trying to add a new entry and they needed to see this number right as they started making the entry, how would you go about that?

    Once again thank you. 

  • realik Profile Picture
    14 on at

    Hi

    I'm in a similar situation. I have a lookup field that provides values and I want to default to the last value when the users select the create new form.

     

    I created a Label and I used the formula:

    Last(SortByColumns('MyList', "MyLookupField", Descending).MyLookupField).MyLookupField

     

    I'm almost to where I need to be...is it possible to then set the default selected value of the lookup field drop down to the label I created (which has the value from the formula above)?

  • DMcCann198 Profile Picture
    10 on at

     


    @realik wrote:

    Hi

    I'm in a similar situation. I have a lookup field that provides values and I want to default to the last value when the users select the create new form.

     

    I created a Label and I used the formula:

    Last(SortByColumns('MyList', "MyLookupField", Descending).MyLookupField).MyLookupField

     

    I'm almost to where I need to be...is it possible to then set the default selected value of the lookup field drop down to the label I created (which has the value from the formula above)?


     

     

    To solve this one I used inspiration from the above commenter @realik  and changed it from descending to Ascending. I also just used the ID table so that each new entry would be the highest and therefore be shown. Hope this helps!

    "Reference Number: " & Last(SortByColumns('YourListName', "ID", Ascending).ID).ID

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard