cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
Microsoft

Re: How to use Insert Trigger on Azure SQL Database with 'Azure SQL' insert row ?

You can certainly simulate this using the Native query feature - this will execute a simple INSERT (nicely parameterized) which will not return the item, but will also avoid the problem of a SQL-side trigger.

 

As of now, you cannot use the InsertItem call, but this will do what we intend InsertItem to do in the future. 

 

Let me know if I can help further.

 

Thanks,

-Cameron

rgparisoto Helper V
Helper V

Re: How to use Insert Trigger on Azure SQL Database with 'Azure SQL' insert row ?

Do you have any example @Cameron? Can I find something?

Microsoft
Microsoft

Re: How to use Insert Trigger on Azure SQL Database with 'Azure SQL' insert row ?

Certainly. If you Select the SQL Connector and the "Execute a SQL Query" operation, you can then enter the query and the formal parameters:

 

query: INSERT INTO [dbo].[PNQ_NewCustomer]([name])VALUES(@name)

formal parameters: { "name": "nvarchar(128)" }

 

This is obviously a very simple example, but you can extrapolate from here.

 

Thanks,

-Cameron

rgparisoto Helper V
Helper V

Re: How to use Insert Trigger on Azure SQL Database with 'Azure SQL' insert row ?

Hi @Cameron!

I found an option do use Stored Procedures.

I made it work with an exception, I can't connect another tables, like when I want to make some logical with.

Do you know someone who used it with Power Apps? 

It will help me a lot to work with the company's inventory.

Thank you.

Regards.

Robson.

rgparisoto Helper V
Helper V

Re: How to use Insert Trigger on Azure SQL Database with 'Azure SQL' insert row ?

Hi @Cameron!

Having good news here...

 

Do you know how to declare variables?

 

I'm trying this and it's not working:

DECLARE

[@Data] DATE,

SELECT
[@Data] = (SELECT TOP 1 [DataCompra]

FROM [dbo].[Ele_Compras]

WHERE [Id_Compra] = @{triggerBody()?['Id_Compra']} )

 

Is it the sabe like SQL Server?

 

Regards,

Robson.

Microsoft
Microsoft

Re: How to use Insert Trigger on Azure SQL Database with 'Azure SQL' insert row ?

@Robson If you are asking about SQL Syntax (I hope I am understanding your question properly...) - it would be like this:

 

formal parameters: { "id_compra": "date"}

 

actual parameters: id_compra: @{triggerBody()?['....']}

 

query: SELECT TOP(1)[DataCompra] FROM [dbo].[Ele_Compras] WHERE [Id_Compra]=@id_compra

 

Now you have a parameterized SELECT statement that can pass in the id from the previous step.

 

 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,245)