cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Impactful Individual
Impactful Individual

SharePoint - For a selected file Trigger

Hi All,

 

I'm trying to use the SharePoint trigger "For a selected file". I don't understand how to make this flow run. I've opened a number of files from the selected SharePoint document library from the same user that created the flow but nothing runs.

 

I found this thread: https://powerusers.microsoft.com/t5/General-Power-Automate/Sharepoint-trigger-for-a-selected-item/td...

 

It is very unclear there if this trigger is supposed to work at all and how it's actually meant to work.

Can someone who understands this please advise?

 

Thanks

Sam

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: SharePoint - For a selected file Trigger

hi @SamPo  for a selected file means that you need to clic on the file to see the flows that you have created.

see

 

file.png

 

when you create a flow for a selected file you are going to be able to see your created flow in the list of automate, clicking right on your file.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: SharePoint - For a selected file Trigger

hi @SamPo  for a selected file means that you need to clic on the file to see the flows that you have created.

see

 

file.png

 

when you create a flow for a selected file you are going to be able to see your created flow in the list of automate, clicking right on your file.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Highlighted
Super User
Super User

Re: SharePoint - For a selected file Trigger

@SamPo  the "For a selected file" does indeed work and works very well. One way I use it several times a week is to publish an adaptive card to our company's All-Staff Teams site whenever I publish a news item on our SharePoint intranet (just another method of putting news in front of staff!)

I have a column in my Site Pages library on our intranet that is a single line of text column, formatted with JSON to show a button that is linked to the flow. When you click on the button the flow starts and posts the item to the Teams channel. The actionParams line should have the  ID of your flow, so you'll need to create the flow first:

0-SP-list.png

The JSON code is as follows (don't forget to change the ID of the flow to yours and to change or delete the  the visibility line:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Publish to Teams",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"021ec4e0-8f85-46b3-a557-a4456960a4eb\"}"
  },
  "style": {
    "background-color": "#468259",
    "color": "white",
    "visibility": "=if(([$PublishedToTeams] == 'Yes'),'hidden','visible')"
  }
}

 

The flow looks like this with the trigger being a SharePoint "For a selected file":

1-flowTrigger-Compose-Get-Compose.png

 

2-Apply-Compose-Post.png

I then update the Site Pages library and switch the PublishedToTeams column to Yes which hides the button in the list. 

3-Update.png

 The result in Teams looks like this:
4-resultTeams.png

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Highlighted
Impactful Individual
Impactful Individual

Re: SharePoint - For a selected file Trigger

@RobElliott @ChristianAbata Thanks both for the detailed explanations.

Highlighted
Super User
Super User

Re: SharePoint - For a selected file Trigger

@SamPo  you are welcome, please consider to mark an aswer as solution to guide others



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
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!

Top Solution Authors
Users online (6,073)