cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Get the PUSH notification in TEAMS application when new row added in SQL DB table

hello,

 

I'm working on Power automation for the first time, and it's really interesting!

I'm working on a use case/flow as below 

 

whenever any new row added to the SQL DB table, I should get the column values as PUSH notification in TEAMS group/channel, for that, I'm currently using the below flow 

 

https://flow.microsoft.com/en-us/galleries/public/templates/5561898f99fb41919d8b8f74c7d95a17/post-me...

 

problem 1: I tested with a sample row 1, and I got the notification, but when I added the second row, my flow still considering the first row as the latest and pushing the notification to TEAMS, how I can do modifications to let the flow know about latest row 

 

problem 2: And how I should let it trigger automatically as soon as it sees a new row in the SQL DB table without manual intervention 

 

p.s: I'm using a regular account, not the premium 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @SP545 :

Q1:

Have you added multiple records to the data source at one time, and you just want to get the first of these records?

The actual situation is whether you insert records manually or insert multiple records through insert. Each newly inserted record will trigger the trigger and return the value of this record.For Example:

1\My data source

Create table IdentityTable(   
Id INT IDENTITY(1,1) CONSTRAINT pk__Id PRIMARY KEY,   
Name NVARCHAR(20) NOT NULL   
);  

2\If I use the following SQL statement to insert 4 new records, this flow will be triggered 4 times and return these 4 records respectively.

INSERT INTO IdentityTable(Name) VALUES ('abc'),('def'),('ghi'),('jkl');  

Q2:

   Usually if your data source has both an IDENTITY column and a primary key, this Flow can be triggered automatically, and you don't need to manually trigger it.

98.gif

Best Regards,

Bof

View solution in original post

Hi @SP545 :

Yes. But you need a shared mailbox.

Step1:Get the email address of your channel

v-bofeng-msft_0-1605841943366.png

 

Step2:modify your flow

I used ‘send an email’ instead of ‘send a message’

BofShare is a shared mailbox.

v-bofeng-msft_1-1605841943373.png

 

The Result

v-bofeng-msft_2-1605841943375.png

Best Regards,

Bof

View solution in original post

6 REPLIES 6
Community Support
Community Support

Hi @SP545 :

Could you tell me:

  • Is there an IDENTITY column in your data table?

Usually the problem you describe is caused by the lack of IDENTITY column.

Firstly, let me explain why you encountered this problem.

The point is IDENTITY column. An IDENTITY column is required for ‘When an item is created’ trigger.

I think this link will help you a lot:

Known issues and limitations

Finally, the solution is to add an identity column in your data table.

I think this link will help you a lot:

Identity Column in SQL Server

In addition, if the problem still can not be solved, you can also try to recreate the trigger.

Best Regards,

Bof

Frequent Visitor

@v-bofeng-msft thanks for your reply, with this identity table I can able to get new rows as notifications in the TEAMS, but I need to have a unique column that acts as Identity as well as PK, but two issues here which I could not able to identify 

 

1) Every time i'm getting the first row along with the latest rows added in the table, I need to use only the rows which I added the latest 

 

2) currently I'm clicking on "SAVE" and "USe data from SQL server" manually every time I test, how I can avoid this manual testing? basically, I want to see when the power automation flow  sees the new rows/insert, as soon as it should  automatically be triggered

Hi @SP545 :

Q1:

Have you added multiple records to the data source at one time, and you just want to get the first of these records?

The actual situation is whether you insert records manually or insert multiple records through insert. Each newly inserted record will trigger the trigger and return the value of this record.For Example:

1\My data source

Create table IdentityTable(   
Id INT IDENTITY(1,1) CONSTRAINT pk__Id PRIMARY KEY,   
Name NVARCHAR(20) NOT NULL   
);  

2\If I use the following SQL statement to insert 4 new records, this flow will be triggered 4 times and return these 4 records respectively.

INSERT INTO IdentityTable(Name) VALUES ('abc'),('def'),('ghi'),('jkl');  

Q2:

   Usually if your data source has both an IDENTITY column and a primary key, this Flow can be triggered automatically, and you don't need to manually trigger it.

98.gif

Best Regards,

Bof

View solution in original post

@v-bofeng-msft thank you for your explanation here, i made some changes to my use case , and it's working , thank you 

 

just have a quick question 

 

in my TEAMS ' notifications, I'm seeing my name as the sender (make sense that I own the flow ) 

but is there any way that I can change from my name to some generic name ( such as my use case name etc., 

 

or login through some kinda system account ? ) 

Hi @SP545 :

Yes. But you need a shared mailbox.

Step1:Get the email address of your channel

v-bofeng-msft_0-1605841943366.png

 

Step2:modify your flow

I used ‘send an email’ instead of ‘send a message’

BofShare is a shared mailbox.

v-bofeng-msft_1-1605841943373.png

 

The Result

v-bofeng-msft_2-1605841943375.png

Best Regards,

Bof

View solution in original post

Frequent Visitor

@v-bofeng-msft thank you, I'll test it as soon as set up the mailbox 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (29,374)