I need to recreate a workflow that we currently have in SharePoint Designer, in Microsoft Flow.
Basically, I need to be able to add a link to restore a list item from an archive by clicking a button on the AllItems.aspx list view. When manually triggered, the flow should set the Archive Status field to Active, make a copy in the Active Forms list and then finally delete from the Archived Forms list.
Is this possible? and is there a way I can manually get a link to trigger a flow this way?
This is the current workflow in SharePoint Designer
This is the current list view where the workflow can be manually triggered from the 'Workflow' column
Yes, there is Flow Trigger for a selected item in the SharePoint connector. This lets you manually trigger a Flow on a selected item in a SharePoint list.
Thanks @Pstork1 . How would I get the trigger link for this Flow so that I can paste it into the 'Workflow' column of the list?
You don't need a trigger link. Once you use that trigger and configure it for a particular list the Flow will show up in the Flow menu by name when you select an item. You can click on it there to launch the flow.
Thanks @Pstork1.
Whilst I know this is possible, from a user perspective it would be a lot simpler if we coudl just have a link (like the image I attached in the original post) where users can just click 'Restore from Archive' which then triggers the workflow directly from this view.
We have also hiiden the toolbar of the list as we don't want users to create/edit new items from this page.
The link to the Flow is realatively easy to get. The problem is the selection is done and passed to the Flow using Javascript. I'm not sure how you reproduce that in a Link.
I have now created the Flow using the 'For a Selected Item' trigger.
Now I just need to get a link that I can add to the 'Restore from Archive' column of my list so that the Flow can manually be triggered by users by clicking this link.
Any ideas?
Hi @Sam12 there are two really nice ways in which you can interact with Flow directly from your list or library. Given that you ahve already used a "For a selected item" trigger and associated with with a list, you will already have enabled one. The one caveat is that this will only work for the modern experience.
If I select an item i.e. I put a check next to it, I then have the ability to execute the Flow by going to the Flow menu and then selecting your Flow. In the screenshot below, my Flow is called "Selected File Demo".
Alternatively, you could have another column (or an existing one) and apply some conditional formatting to it, and have that as a clickable link. In the following example, I have created a standard text column called Flow. On the column header, I have then selected Format this Column.
When the formatting blade opens on the right hand side, I have used some JSON to configure the way in which the column is formatted. There are lots of articles out there about column formatting which are worth taking a look.
The JSON which have used is as follows:
{ "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", "elmType": "button", "customRowAction": { "action": "executeFlow", "actionParams": "{\"id\": \"154a59a0-99cf-4815-a39b-73612866043a\"}" }, "style": { "border": "none", "background-color": "transparent", "color": "#0078d7", "cursor": "pointer" }, "children": [ { "elmType": "span", "attributes": { "iconName": "Flow" }, "style": { "padding-right": "6px" } }, { "elmType": "span", "txtContent": "Launch Flow" } ] }
The string above which is highlighted red is your Flow ID. You can find this by navigating to your Flow summary page, and looking at the URL. You need the string which appears between flows and details e.g.
flows/THIS IS YOUR FLOW ID/details
You could apply the above to your restore from archive Flow to get the user experience that you're looking for.
Thanks @MattWeston365 - I have changed my list to modern experience. Visually it looks like this has worked however the link doesn't appear to be clickable.
It also doesn't appear to have synced through to the page where I have embedded the list:
Are you seeing your Flow appear as in screenshot 1? If so, does that method work? If that works then we can concentrate on the column formatting. If not, then we have an issue with the Flow so can focus there.
I have managed to get the link working now directly in the list (I needed to add myself to the Run Only group).
However, the link disappears when I try to embed the list view to a site page. Any ideas?
The start Flow behaviour won't work through the List or Library web parts unfortunately. This is because the web parts lack the interfaces to Flow i.e. you won't have the Flow button on the activity bar. So the only place this can actually start is within the list or library itself.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
25 | |
23 | |
23 | |
21 |
User | Count |
---|---|
62 | |
44 | |
40 | |
29 | |
27 |