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 / Possible to run an SQL...
Power Apps
Unanswered

Possible to run an SQL Agent Job?

(0) ShareShare
ReportReport
Posted on by

I have several agent jobs that it would be EXTREMELY helpful if Power Apps could run them (load and refresh some data from a feed).

 

Has anyone else done this?  They would be on an SQL Server that lives in IaaS not as Azure SQL Service.

Categories:
I have the same question (0)
  • Thealster Profile Picture
    37 on at

    Agent jobs usually run as scheduled tasks. What you could try is to create stored procedures and run these from triggers in the table being updated by PowerApps data?  Would that work?

  • Community Power Platform Member Profile Picture
    on at

    Yes, that would be an option.

     

    I take it there is no way to call a stored procedure from power apps directly?

     

    That said, yeah I could make a table and then have the stored procedure UPDATE that table's record with "processing" and "completed" and then Power Apps could just refresh that view waiting for it to finish so the user gets confirmation when all is done.

  • cpl123 Profile Picture
    4 on at

    That would be very nice if that was possible. I'm also looking for something like this

  • Thealster Profile Picture
    37 on at

    I read somewhere just recently that there was a way to now call stored procs from PowerApps. 

     

    Does anyone one know how this can be done?

  • fastlanebi Profile Picture
    30 on at
    That would be helpful. I need this functionality also. Otherwise the trigger on value change idea will be necessary but not very neat as we are looking for code free solutions from Power apps.
  • fastlanebi Profile Picture
    30 on at

    Solved - The SQL Server connector does have this operation as standard. Namely Operation ID: ExecuteProcedure Called Execute Stored Procedure

     

    Let's try it out.  Let me know how you go.

     

    David Taylor

    FAST LANE BUSINESS INTELLIGENCE

    www.fastlanebi.com

     

     

  • AndreWx01 Profile Picture
    2 on at

    Hola!!

      No hablo ingles, pero lo puedes traducir …

     

     

    • Modificar y Crear SP_START_JOBV2 
      • Crear solo 1 variable
      • Declarar las demas 
    CREATE PROCEDURE [dbo].[sp_start_jobV2]
     @JOB_name sysname
     
    AS
    BEGIN
     DECLARE @JOB_id_as_char VARCHAR(36)
     DECLARE @retval INT
     DECLARE @SteP_id INT
     DECLARE @JOB_owner_sid VARBINARY(85)
     DECLARE @JOB_id UNIQUEIDENTIFIER = NULL
     DECLARE @error_flag INT = 1 -- Set to 0 to suppress the error from sp_sqlagent_notify if SQLServerAgent is not running
     DECLARE @server_name sysname = NULL -- The specific target server to start the [multi-server] job on
     DECLARE @SteP_name sysname = NULL -- The name of the job step to start execution with [for use with a local job only]
     DECLARE @output_flag INT = 1 -- Set to 0 to suppress the success message
    • Crear nuevo SP , para llamar Job
    ALTER PROCEDURE [dbo].[llamar_job] 
     @LLAMAR varchar (50)
    	
    	AS
    BEGIN
    
     exec msdb.dbo.sp_start_jobV2 @llamar
    
    END
    • Power Automate > Flow > Button PowerApps

    AndreWx01_1-1626277546918.png

    • Test Flow

     

    AndreWx01_2-1626277767043.png

     

    • AndreWx01_3-1626277832166.png

       

    • AndreWx01_4-1626277882511.png

       

     

    Saludos

     

     

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard