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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calling a ROW-LEVEL UP...
Power Automate
Unanswered

Calling a ROW-LEVEL UPDATE SQL Server Stored Procedure from Power Apps

(0) ShareShare
ReportReport
Posted on by 12

Hi Folks

 

My group is familiar with calling stored procedures from Power Automate, where the generalized scenario is that you are returning a result set (rows).

 

This scenario is different, the underlying stored procedure takes in the SINGLE row to be updated. The row fields are both INPUT AND OUTPUT parameters + plus a RETURN CODE (giving you status on the update). So we aren't really getting a row set, we are getting a refresh of the same record (if successful) and always a return code.

 

Objectives:

 

1. use the same stored procedure we'd use with any other technology (.NET, Java, MS Office, etc.)

2. use real-world optimistic concurrency => RowVersioning (because .Net and Java, have their own persistence mechanisms, like Entity Framework and Hibernate, that Power Automate does NOT)

3. use real-world update checking like hash-bytes, to know that values have actually changed (versus wasting an update needlessly)

4. use Power BI Canvas Apps like we would use any other form-like technology and choreograph updates with all of the other form and non-form (batch jobs) technologies we already have in our enterprise.

 

So we have all of your 101 examples, for demonstrating optimistic concurrency (.Net, Java, MS Office, Enterprise Automations, etc.), except via the Power Suite. They all work and play well, so we can hand them off to folks to learn, pattern from, understand best practices, regardless of technology framework. They all walk, quack, etc. the same and play well.

 

The dilemma is to understand how to get back that same row/fields and return code (using the stored procedure updated standards we have in place, and without changes and/or minimal changes).

 

Screen shot here, to better help with the understanding the Canvas App (with Power Automate behind it).

Power BI reference for Optimistic ConcurrencyPower BI reference for Optimistic Concurrency

 

Categories:
I have the same question (0)
  • tutor Profile Picture
    12 on at

    just so we are all on the same page, without throwing around several rounds of questions, here is the SQL Server 2019 stored procedure interface:

     

    ALTER PROCEDURE [dbo].[Ops_UpdateSingleRow]
    (
    @TypeID int OUTPUT,
    @Namenvarchar(20) = NULL OUTPUT,
    @TypeDescription nvarchar(50) = NULL OUTPUT,
    @IsActive bit = NULL OUTPUT,
    @ModUserID nvarchar(50) = NULL OUTPUT,
    @ModDateTime datetime = NULL OUTPUT,
    @CreateUserID nvarchar(50) = NULL OUTPUT,
    @CreateDateTime datetime = NULL OUTPUT,
    @RowVersionID bigint=NULL OUTPUT,
    @Original_TypeID int OUTPUT,
    @RetCd int OUTPUT
    )
    AS

    :

    return codes:

    -1 = success

     1 = UPDATE NOT NEEDED - DUPLICATE OF ROW IN DATABASE  (user keeps hitting the SUBMIT instead of being smart enough to press CANCEL)

     2 = DATA IN DATABASE ROW NEWER

     3 = ROW IN DATABASE NO LONGER EXISTS -or- IsActive = False

    (everything else is logged with the SQL Server hard error)

     

  • tutor Profile Picture
    12 on at

    Surprisingly, I expected a flood of responses? This is really kind of concerning. This means that there are millions of Power BI developer folks, who are Excel or Automation savvy, but who have never had a Database 101 course, who are potentially deploying thousands of apps which are having end users simply overlay each others database rows?

     

    This is really kind of shocking (being an IT guy since 1977). Power BI developers are very much trainable, but it's kind of critical that they understand 101 architecture/reference design which are standards for other software development trainings. Scary is the fact that stored procedure automation functionality is here, but that no one has ever mentioned this scenario functionality. (My prayers are with the data service and support folks attempting to fix resulting damages without any kind of an audit trail for update transactions - sincerely/respectfully.)

     

     

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!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard