cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
heyvOOn
Helper I
Helper I

Post Adaptive Card to Teams when Sharepoint News is created/modified

Hello Everyone,

 

I've been trying to configure a Flow to post messages to Teams whenever a News post is created/update in Sharepoint. I've tried every possible combination and could not get it right. Does anyone have accomplished this? Any help would be great appreciated. 

I understand that all site news are under;

heyvOOn_0-1614096133144.png

So in theory, if I use;

heyvOOn_1-1614096195270.png

I could get the job done. Wrong! I can't get this to work;

heyvOOn_2-1614096344198.png

 

Thank you all in iadvance and stay safe 😉

1 ACCEPTED SOLUTION

Accepted Solutions
heyvOOn
Helper I
Helper I

Mission accomplished! 

The following flow will send an Adaptive Card to a Teams channel of your choice whenever a News is created/updated in your Sharepoint Site.

heyvOOn_0-1614588240898.png

 

Thank you @Expiscornovus  for you help on this one. 

 

I leave here a link to a video tutorial I've made on how to achieve this step-by-step.

https://youtu.be/sHUPqGDKqpk

View solution in original post

8 REPLIES 8
Expiscornovus
Super User
Super User

Hi @heyvOOn,

 

I would use the Get file properties action instead of the Get Files (properties only) action.

 

Use the GUID of the site pages library as a custom value in the Library Name. And use the following expression to retrieve the id from the x-ms-file-etag field from the trigger action.

replace(split(triggerOutputs()?['headers/x-ms-file-etag'], ',')?[1], '"', '')

 

getfilesitepage.png

heyvOOn
Helper I
Helper I

Hi @Expiscornovus 

 

Thank you for your help. Your Function seem to helped me pass the error. But now I can't seem to get the GUID from the library below? 

heyvOOn_0-1614168144134.png

 

Expiscornovus
Super User
Super User

Hi @heyvOOn,

 

You should be able to find that GUID on the library settings page.

 

1. Go to the Site Page Library. Click on Library settings in the settings menu.

 

sitepages_librarysettings.png

 

2. Spot the ID in the address bar after List= between the curly brackets.

 

listid_sitepages.png

heyvOOn
Helper I
Helper I

I found the GUID and put there where you said but it doesn't work. 

heyvOOn_0-1614181694060.png

 

heyvOOn
Helper I
Helper I

Hi @Expiscornovus

 

Seem like I got it to work with the library name instead of the GUID but I still have an issue. 

The Adaptive Card it's sending to Teams is not the one that I've I changed. When I change a page. The flow detects the change in the folder but it sends an Adaptive Card to Teams with a random page, not the one I've updated.

heyvOOn_0-1614183334733.png

 

 

heyvOOn
Helper I
Helper I

Mission accomplished! 

The following flow will send an Adaptive Card to a Teams channel of your choice whenever a News is created/updated in your Sharepoint Site.

heyvOOn_0-1614588240898.png

 

Thank you @Expiscornovus  for you help on this one. 

 

I leave here a link to a video tutorial I've made on how to achieve this step-by-step.

https://youtu.be/sHUPqGDKqpk

Expiscornovus
Super User
Super User

@heyvOOn, great to hear you got it working 🙂

Hi heyvOOn,

 

would it be possible to copy and paste here the json you used for the card?  I would be very grateful if I could you the same design. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,639)