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 / Update Sequence Number...
Power Apps
Answered

Update Sequence Number in SQL Table

(0) ShareShare
ReportReport
Posted on by 29

I have a pretty basic app to submit bids to an on-premise SQL server for aution items. The issue I'm having is updating the sequence number. I am using the following code:

Patch(Bids,Defaults(Bids),
{Item_Number:Value(subtxtItem.Text)};
{Bidder_ID:Value(BidderNumber.Text)};

 

{Amount_Bid:Value(SublblAmount.Text)};
{Maint_Userid:lblMaintID.Text};
{Maint_Date:Value(lblMaintDate.Text)};
{Create_Userid:lblCreateID.Text};
{Create_Date:Value(lblCreateDate.Text)};
)

The field for Seq_No would be between Bidder_ID and Amount_ID in the code?

The table is empty right now.

I have no idea what the code should be to submit to the Seq_no field in the table to increment by 1 for each submitted record.

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @RussHaight 

    You can get the sequence number prior to submitting your record.

    To get the most recent, utilize the following type of formula:

    First(Sort(Bids, Seq_No, Descending)).Seq_No

     

    If you happen to put this in a label (let's say) text property, it should show you the latest Seq_no.

     

    Then your formula to submit your data would be:

    Patch(Bids, Defaults(Bids),
     {Item_Number:Value(subtxtItem.Text),
     Bidder_ID:Value(BidderNumber.Text),
     Amount_Bid:Value(SublblAmount.Text),
     Maint_Userid:lblMaintID.Text,
     Maint_Date:Value(lblMaintDate.Text),
     Create_Userid:lblCreateID.Text,
     Create_Date:Value(lblCreateDate.Text),
     Seq_No: Value(yourLabel.Text) + 1
     }
    )

     

    I hope this is helpful for you.

  • Verified answer
    RussHaight Profile Picture
    29 on at

    That worked like a charm! thank you

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard