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 / ID for a Batch (like s...
Power Apps
Answered

ID for a Batch (like shopping cart)

(0) ShareShare
ReportReport
Posted on by 45

Hello

Im working on an app to create new selling orders. It works as a shopping cart.

The thing is that I am saving the information on Sharepoint List, every item is a new line on the List.

But 1 order may have 5 items inside, so on the list I will have 5 lines, and I want all of them to have the same order number.

Finally, I need to execute this action at the end of the process, since different users will use the app at the same time, I cannot create the ID when I create the item, I need to do it when I send the order confirmation.

The Items added to the order are managed inside a collection.

 

Basically I need to: check the last order number (I do it with first-->sort.descending), and then with a for all (or something like that), add that number to all the collection (must always be the same number) and add the collection to the list.

 

pwagma_0-1597332937719.png

Example picture, the "number order" it is under the tag "Numero de Pedido".

 

Thanks,

Pablo

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    All you need to do is Submit the "order" form first, then you can set a variable to the LastSubmit of that form. Us that ID number to populate the list of "items" in the order. Check out this series of videos:

    https://www.youtube.com/watch?v=xgznk4XlPCo

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@pwagma,

    Based on the issue that you mentioned, do you want to save the order number to the SP list?

    Could you please share a bit more about your app configuration, how you design your app?

    Actually, I could not get your SP list data set, this 'Cliente' represents the customer? If so, why don't you add a column to store the order amount which avoids the repeated clients and get you a unique order number? 

    I have made a test on my side, please take a try as below.

    Set the Default property of the TextInput control belongs to the OrderNumber DataCard as below:

     

    If(
     CountRows(
     Filter(
     Pedidos,
     Cliente.Value = DataCardValue5.Selected.Value
     )
     ) >0,
     Value(
     LookUp(
     Pedidos,
     Cliente.Value = DataCardValue5.Selected.Value,
     'OrderNumber (Client)'
     )
     ),
     Value(Last(Pedidos.'OrderNumber (Client)').'OrderNumber (Client)') + Value(1)
    )

     

    Note: In my SP list, the 'Client' is a Choice column.

    0819Gif2.gif

    Best Regards,

    Qi

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
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard