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

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,297 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard