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 can i Automate a C...
Power Apps
Answered

How can i Automate a Consecutive order

(0) ShareShare
ReportReport
Posted on by

Good day, I require your support:

I have an application with multiple accesses to sharepoint lists. Which is used by various administrative areas. Every day we make orders, which have a numerical order.

There is some way that when a partner goes to create a new order, the consecutive order is automatically selected.

Currently we do it in an excel shared by Teams and it is easy to see this.

However, the director requires reports of this information in BI and from Excel, there are problems with the standardization of the data. 

 

This first column is what i want to show or do automateThis first column is what i want to show or do automate

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @Anonymous ,

    The next number would be

    First(
     Sort(
     YourListName,
     YourNumberField,
     Descending
     )
    ).YourNumberField+1

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Thanks for the support. Sounds like it will work.

    Could you support me step by step? Where should I integrate this formula?

    A doubt, this formula will continue adding. But everyday changes, orders start at 1 again. It is also possible?

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    OK @Anonymous ,

    The easiest way would be to have this field on your form and have this as the Default value of the control (replace everything with Your in front with the actual names)

    If(
     YourFormName.Mode = FormMode.New,
     First(
     Sort(
     YourListName,
     YourNumberField,
     Descending
     )
     ).YourNumberField+1,
     Parent.Default
    )

     

    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.

     

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Hi @WarrenBelz ,

     

    Idk if im doing this rigth. 

    I put your code in the Default Value on PowerApps. But its detects error.

     

    I have to change the , to ; 'cause mi region. But the error seems to be in the end, if i copy paste like you this happens: z.png

    And if i delete the dot : 
    z.png

     

    Some Help?

     
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @Anonymous ,

    There is something else wrong here - in the below, the highest number I have in my test list is 4 and the code gets me 5.NextNumber.png

     

     

     

     

     

     

    What does the error say when you hover over the red cross? Also for the moment delete Parent.Default and see if that is the issue.

    Also please confirm you have this code in the Default of the Control, not the DataCard.

     

    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.

     

  • Community Power Platform Member Profile Picture
    on at

    Great, with this code I could already do it without error, however, it is not specifically what I am looking for.

    What this code does is add 1 to the number of my column of daily orders. However, it does not restart when starting another day. Example today 04/28, we have 40 orders. Tomorrow this should start again from 1.

     

    Its possible?

  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @Anonymous ,

    Sorry I missed your post - if you tag me in the reply, it is much easier to see in my feed.

    That is a whole new question to what you asked in your post. This is getting much more complicated - the direction you would need to take would be to first test for existing records on that day and then use the formula if they were present, or set to 1 if not. So set a Variable at some point

    Set(
     vExist,
     !IsBlank(
     Lookup(
     YourListName,
     YourDateField=Today(),
     YourDateField
     )
     )
    )

    This will return true or false as to whether a record exists for the day.

    Then it gets a bit more complex again in the Default as you now have to find the highest number for the day

    If(
     YourFormName.Mode = FormMode.New,
     If(
     vExist
     First(
     Sort(
     Filter(
     YourListName,
     YourDateField = Today()
     ),
     YourNumberField,
     Descending
     )
     ).YourNumberField+1,
     1
     ),
     Parent.Default
     )

    Note I have free-typed this, so please check all commas/brackets.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    @WarrenBelz Hi,
    I put the set in OnVisibile of the screen and everything is fine.

    16.png

     

    when I put the rest of the formula it marks me error (an operator was expected):
    If (
       Form1.Mode = FormMode.New;
       If (
          vExist
          First (
             Sort (
                Filter (
                   Orders;
                   Date = Today ()
                );
                Daily Order;
                Descending
             )
          ) .DailyOrder + 1;
          one
       );
       Parent.Default
     )

     

    Any advice? or something am I doing wrong?

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    @Anonymous ,

    What is the one reference - it has no operator after it

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard