Add a "run flow" button to a list view in SharePoint

Поделиться
HTML-код
  • Опубликовано: 31 окт 2022
  • If you have an "Instant" flow configured in SharePoint ("For a selected item" or "For a selected file" triggers) and want to make it easier for folks to run that flow, this video is for you. I'll show how to add a column with a stylish button to run that flow.
    NOTE: I recently learned that this process only works for flows in your tenant's default environment as there is no way to specify the environment in the JSON code.
    Helpful links
    Share an instant flow by adding run only users: learn.microsoft.com/en-us/pow...
    (in order for others to be able to run the flow using that button, they need to be run only users)
    Create a "Format only" column:
    thechriskent.com/2018/08/29/l...
    Advanced formatting concepts (Includes JSON code you'll need to copy):
    learn.microsoft.com/en-us/sha...
    Fluent Icons Search:
    www.flicon.io/
  • НаукаНаука

Комментарии • 76

  • @stephanedenis5394
    @stephanedenis5394 Год назад +1

    I discovered your channel recently. I watched several videos, very good work. Superb presentation that gives me clues about an upcoming project. A channel to follow!

  • @brucekleine1775
    @brucekleine1775 Год назад +1

    Thank you! Very helpful and easy to follow.

  • @imran002ali
    @imran002ali 5 месяцев назад +1

    Hi Chad, it was easy, quick and to the point, thank you 👍👍

  • @pawanmishra6549
    @pawanmishra6549 Год назад +1

    It is very helpful and handy way, I have used it and its quite popular in end user community. thanks Chad, have a good day

  • @martinargimon730
    @martinargimon730 3 месяца назад

    excellent Chad. Thanks a lot !

  • @thermant8452
    @thermant8452 10 месяцев назад

    🔥🔥🔥🔥🔥🔥 love this. Thanks!!

  • @karenwalton1636
    @karenwalton1636 7 месяцев назад

    Thanks for the video, very useful for someone new to Sharepoint and PA! Are you able to pass the line items over to PA on the row you have 'clicked' the button for?

    • @cvkealey
      @cvkealey  7 месяцев назад +2

      This method works with the "For a selected item" ( or file) trigger, which returns the id of the item or file. You then use a "Get item" or "Get file properties" action to get the details of that item/file.

  • @maexrock7608
    @maexrock7608 Год назад +1

    Hi Chad and many thanks for providing this tutorial. I am wondering if it‘s possible to present such buttons inside the list form. Background is a board based view where the button is not visible (and this is ok, i want to have clean/situation depending cards). But if the user clicks to open the form i would like to enable an „one click action“ to run a flow. Any hint if this is achieveable would be very appreciated.

    • @cvkealey
      @cvkealey  Год назад +1

      Displaying the buttons on a card/gallery view is possible (just take the formatting code and replace it in the formatting for that view), but getting them to appear on the list form is (in my experience) more complicated. I've had a few cases where they just showed up there, but I've never been able to figure out why or make the formatting appear on a particular form. It's one of those things I keep on the back burner until I have some free time. I'm fairly certain I've seen Chris Kent demo that capability, but cannot find the video.

  • @martinnoah9716
    @martinnoah9716 7 месяцев назад

    Awesome idea and video. Any idea if this will work with a document library?

    • @cvkealey
      @cvkealey  7 месяцев назад +1

      Yes, as long as your flow uses the For a selected file trigger.

    • @martinnoah9716
      @martinnoah9716 7 месяцев назад

      @@cvkealey gotcha. What was/is tripping me up is I cannot find “For a selected file” trigger when creating a new flow from scratch. I ended up using a template that has that trigger.

    • @cvkealey
      @cvkealey  7 месяцев назад

      @@martinnoah9716it's classified as an "Instant" trigger. So, when creating a flow from scratch, select New > Instant cloud flow, then scroll down and you should see "For a selected file" in the list.

  • @rafalstasiuk448
    @rafalstasiuk448 Год назад

    That was a helpful video. Do you have a link to your flow? how is it built

    • @cvkealey
      @cvkealey  Год назад +2

      This will work for any flows that use the SharePoint triggers "For a selected item" or "For a selected file" and are connected to that particular list or library.

    • @rafalstasiuk448
      @rafalstasiuk448 Год назад

      @@cvkealey Do you have an example of a flow where you get submitter name from a sharepointlist?

    • @cvkealey
      @cvkealey  Год назад

      @@rafalstasiuk448 if by "submitter" you mean the person who created the item or file, that would just be the "Created by" value for the item. That's a person type field, so it has properties of DisplayName and Email (as well as a few others, but those are the most useful). If you mean (in the case of a manually started flow) the person who initiated it, the trigger will output several "User " properties (e.g.: "User name" is the display name of the person who initiated the flow run).

  • @pramatheshnimkar2203
    @pramatheshnimkar2203 Год назад

    Thank you. And what if we don't want user to clock the "Run Flow" but rather directly run it? Is there any action for that

    • @cvkealey
      @cvkealey  Год назад +1

      As far as I know, that's not possible. You can customize the flow launch panel to change the text that appears at the top and on the button to start it (see thechriskent.com/2019/05/02/customizing-the-flow-panel-with-list-formatting-actionparams/), but there's no way around the user needing to click that button to start the flow. I actually prefer this because it minimizes the risk of the flow being run unintentionally.

    • @pramatheshnimkar2203
      @pramatheshnimkar2203 Год назад

      @@cvkealey you are great! The link is exactly what I was looking for

  • @denisetarango7020
    @denisetarango7020 Месяц назад

    We have a few different workflows that we start this way (“For a selected item”). Is there a way to create a column but then have the button display a list of available workflow for the user to choose from? We are really liking the column approach, however, we would like to avoid having a column per workflow.

    • @cvkealey
      @cvkealey  Месяц назад

      It is possible to show multiple buttons or links in the same column, each launching a different flow. The code below is from a task list where two different flows can be run. It might be possible to display a drop-down to select which flow, but that's beyond my abilities.
      {
      "$schema": "developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "style": {
      "flex-direction": "column"
      },
      "children": [
      {
      "elmType": "button",
      "customRowAction": {
      "action": "executeFlow",
      "actionParams": "{\"id\": \"66986db6-e468-4525-96f2-8c10085d93e2\"}"
      },
      "attributes": {
      "class": "ms-font-m ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
      },
      "style": {
      "border": "none",
      "background-color": "transparent",
      "cursor": "pointer",
      "display": "=if(Number([$TasksGenerated]) == 0,'inherit','none')",
      "padding-top": "6px"
      },
      "children": [
      {
      "elmType": "span",
      "attributes": {
      "iconName": "Trackers",
      "class": "ms-font-xl"
      },
      "style": {
      "padding-right": "6px"
      }
      },
      {
      "elmType": "span",
      "txtContent": "Create tasks"
      }
      ]
      },
      {
      "elmType": "button",
      "customRowAction": {
      "action": "executeFlow",
      "actionParams": "{\"id\": \"cfbb5367-58e8-4e89-8a70-35a4f95eb707\"}"
      },
      "attributes": {
      "class": "ms-font-m ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
      },
      "style": {
      "border": "none",
      "background-color": "transparent",
      "cursor": "pointer",
      "display": "=if(Number([$TasksGenerated]) == 0,'none','inherit')"
      },
      "children": [
      {
      "elmType": "span",
      "attributes": {
      "iconName": "RecurringTask",
      "class": "ms-font-xl"
      },
      "style": {
      "padding-right": "6px",
      "padding-top": "3px",
      "padding-bottom": "6px"
      }
      },
      {
      "elmType": "span",
      "txtContent": "Replace tasks"
      }
      ]
      }
      ]
      }

  • @devinbernsie1319
    @devinbernsie1319 Год назад

    the flow starts as an automated cloub flow and "for a selected item" and immediately to send an email or do I need a condition?

    • @cvkealey
      @cvkealey  Год назад

      This method works with Instant cloud flows using the "For a selected item" or "For a selected file" triggers. The flow could just immediately send an email if that's what you want/need it to do. If you want that email to be conditional (example: "if this column's value is greater than this number" or "if this status column's value is approved"), then, yes, you would need a condition in that case.

  • @user-eq3yz7pw1v
    @user-eq3yz7pw1v Год назад

    should the flow be in the default environment as is the case for the out of the box button?
    I have followed the exact steps and the flow is triggered on "For a selected file" but does not respond to the click

    • @user-eq3yz7pw1v
      @user-eq3yz7pw1v Год назад

      P.S in my case I don't have a list but a file

    • @cvkealey
      @cvkealey  Год назад +1

      Apparently, this only works with flows in the default environment (see powerusers.microsoft.com/t5/General-Power-Automate/Trigger-Flow-from-SPO-List-button-not-working-if-flow-sits-in/td-p/619570). I was not aware of that limitation and will update the video description accordingly. I tried adding the environment to the json in what should be the correct format, but it simply doesn't recognize it as valid JSON.

    • @user-eq3yz7pw1v
      @user-eq3yz7pw1v Год назад

      @@cvkealey thank you! Very useful.

  • @nurshazleen2150
    @nurshazleen2150 7 месяцев назад

    hi, i want to ask. what if i already created the approval flow in power automate where when the user click save button in the sharepoint list form, the approval automatically start. but then, what will happend if i create this button? how to stop the auto approval flow and use thing only

    • @cvkealey
      @cvkealey  7 месяцев назад

      It sounds like you used the "When an item is created" trigger. You would need to remove that and replace it with the "For a selected item" trigger.

  • @HazzR8
    @HazzR8 Год назад +1

    What kind of flow trigger would you use?

    • @cvkealey
      @cvkealey  Год назад +1

      This will work with the "For a selected file" trigger in libraries and "For a selected item" trigger in lists.

  • @somo1ful
    @somo1ful Год назад

    Why does the column need to be read-only calculated? The button seems to appears no matter what the column type was. Also is there any way to make the button work in detailed view?

    • @cvkealey
      @cvkealey  Год назад

      The column doesn't NEED to be a calculated column, but the main reason for using that is to prevent it from appearing in the edit form for an item and minimize confusion. To give credit where due, I got this idea from Chris Kent: thechriskent.com/2018/08/29/list-formatting-quick-tip-format-only-columns/. I'm not sure what you mean by "detailed view"...can you clarify?

    • @somo1ful
      @somo1ful Год назад

      @@cvkealey oh ok thanks.
      "Detailed view"/popup/edit form, wasn't sure what to call it but the button doesn't work there(?).

    • @cvkealey
      @cvkealey  Год назад

      @@somo1ful That is correct...I'm seeing the same behavior. It also doesn't work in a tiled/gallery or board type view of the list. I suspect there's a workaround for this, but don't know what that is. I'll have to do some testing.

  • @workflow365
    @workflow365 7 месяцев назад

    Is it possible to visually ‘show’ when this button in the past has been pushed? This to avoid that another collegae push the button again.

    • @cvkealey
      @cvkealey  7 месяцев назад

      You can add another column, like a date/time column, to record that the workflow has been started. If so, you can either just hide the icon/button, or show a different icon or message.

  • @SyzygyKNH
    @SyzygyKNH 7 месяцев назад

    What does the Flow do? In one of your comments, you state the button sends the Id of the List item to the Flow and your Flow uses this information to send the email to the owner of the list item and also provide the List item's status?

    • @cvkealey
      @cvkealey  7 месяцев назад

      The flow can do whatever you need it to do. By starting it "for a selected item", the ID of the item is automatically passed into the flow, so with that, you can get the full details of the item (using the Get item action) and do whatever you need it to do.
      In other words, this is just a means of launching any flow that uses the "for a selected item" trigger.

  • @tiwu
    @tiwu Год назад +1

    Hi i have an issue, other users can't click the button. if they do nothing happens. if i click the button i see a process working in the upper corner and the flow is´triggered as well.
    Any ideas?

    • @cvkealey
      @cvkealey  Год назад

      Have you added those users as ”Run only" users to the flow? Without that access, they can't initiate the flow. See
      learn.microsoft.com/en-us/sharepoint/dev/business-apps/power-automate/guidance/manage-list-flows

    • @tiwu
      @tiwu Год назад

      ​@@cvkealey Ty vm it works now, do you know how to get the users displayname or upn who started the flow into the http request? perhaps in the json body somehow?

    • @cvkealey
      @cvkealey  Год назад

      Yup...see this video: ruclips.net/video/AGiv60AWCm4/видео.html

    • @tiwu
      @tiwu Год назад

      Got it TY vm!!! u are a life saver!

  • @emarnold517
    @emarnold517 Месяц назад

    Can the run flow button be changed to say submitt?

    • @cvkealey
      @cvkealey  Месяц назад +1

      Yes! There's an optional parameter (runFlowButtonText) that you can set to change the text displayed on the button. See thechriskent.com/2019/05/02/customizing-the-flow-panel-with-list-formatting-actionparams/ for details.

  • @Justhelloworld
    @Justhelloworld 5 месяцев назад

    How do i add this button in the item? when you are in the list and press on a item?

    • @cvkealey
      @cvkealey  5 месяцев назад

      If you mean in the "view form" for the item, I have not found a reliable way to do that. If you use a text column to hold the formatting and that column has a value (that is, it's not blank), then the formatting will appear in the form, but will not function as intended (it just lets you edit the value in the column rather than opening the flow launch panel).

  • @SuperMarvz
    @SuperMarvz 2 месяца назад

    How can we bypass the run flow button? Like the flow will just run automatically? Its just to streamline the process

    • @cvkealey
      @cvkealey  2 месяца назад

      Can't bypass the "Run flow" button. This is more to make the process of starting an instant flow easier to the end user, but not so easy that they'll do so accidentally. In fact, most such flows that I create have, in the description (which appears at the top of the launch panel) a warning of sorts. Something like: "NOTE: This flow will . If you DO NOT want to do this, click Cancel. If you do, click Run flow"

    • @SuperMarvz
      @SuperMarvz 2 месяца назад

      @@cvkealey Yeah, figured its by design behaviour of PA flows when running thru JSON format. I did a work around and use canvas app to fulfill my requirements.thanks btw.amazing content as always!

  • @mithunmohan6927
    @mithunmohan6927 6 месяцев назад

    Will this work only to trigger flows in default environment? I tried to trigger a flow in different environment. It is not working. Is it possible to pass the environment I'd?

    • @cvkealey
      @cvkealey  6 месяцев назад

      I have not tried with a flow in another environment. The instructions (see second link in the video description) for getting the id of a solution aware flow seem to indicate that it should work for flows in a non-default environment.

    • @Myjestic12
      @Myjestic12 6 месяцев назад

      I think this approach is not working anymore. You have to apply the trigger "When a http request is received" to your flow. It is a premium trigger but it works without premium for now 🤷🏻‍♂️.

    • @cvkealey
      @cvkealey  6 месяцев назад +1

      @@Myjestic12 the new flow editor doesn't like the "for a selected item" or "for a selected file" triggers. If you use the classic editor, it works fine. Trust me, I set up four of these this week.

    • @mithunmohan6927
      @mithunmohan6927 6 месяцев назад

      @@cvkealey I used the Flow Id from My Flow->Export-> Get flow identifier. And now iam able to trigger flows from different environment

    • @cvkealey
      @cvkealey  6 месяцев назад

      @@mithunmohan6927 good to know!

  • @himanshupatel2787
    @himanshupatel2787 5 дней назад

    Hello,
    If I give editor access to foe example 10 ppl to this same sharepoint list. and put button to run flow. I created flow in my "power automate and I am using that flow ID in that button. now if some other editor trigger flow, so the email will go under that editors name. how do I make this email sent from that person who trigger the flow. I have that person email column. can I somehow set that person?

    • @cvkealey
      @cvkealey  4 дня назад

      For others to be able to run the flow, you need to make them "run only" users. See learn.microsoft.com/en-us/power-automate/create-team-flows for more details. When you do that, you can set whether the flow runs with their connections or yours. To have the flow send email as them, it needs to run with their connections.

    • @himanshupatel2787
      @himanshupatel2787 4 дня назад

      @@cvkealey I can not see run only option in my flow. I can see Connections, Owners. Maybe I don't have admin access?

    • @cvkealey
      @cvkealey  4 дня назад

      What trigger does your flow use?

    • @himanshupatel2787
      @himanshupatel2787 4 дня назад

      @@cvkealey I convert my flow to manual trigger flow. It's working, because I can share access to the sharepoint editor. so the email send by who is triggering the flow.

  • @Trysomieflexntjes
    @Trysomieflexntjes 27 дней назад +1

    Siiiiiiii🎉

  • @xAdy11
    @xAdy11 7 месяцев назад

    i did exactly the same thing but it says : ,,Couldn't start flow "name of my flow". Failed " any ideas ?

    • @cvkealey
      @cvkealey  7 месяцев назад

      What trigger does the flow use? This method *only* works with instant triggers from the SharePoint connector ("For a selected item" in lists or "For a selected file" in libraries). If you're using one of those, make sure you've got the proper/complete flow ID.

    • @xAdy11
      @xAdy11 7 месяцев назад

      @@cvkealey it is a reccurence

    • @cvkealey
      @cvkealey  7 месяцев назад

      @@xAdy11 then you can't trigger it using this method.

    • @xAdy11
      @xAdy11 7 месяцев назад

      @@cvkealey ok, thank you. i will try another trigger

    • @cvkealey
      @cvkealey  7 месяцев назад

      @Ady-sk4tj what does the flow actually do? Recurring flows usually operate on multiple items in a list, while the "for a selected..." triggers operate on a single item. They're both useful in different ways.