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

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
Level: Powered On

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 Employee

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
Level: Powered On

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
Level: Powered On

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.

Highlighted
Microsoft Employee

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 504 members 4,577 guests
Please welcome our newest community members: