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

Flow button in document library

I am wondering if its possible to add a button on SharePoint online document library where when its clicked a flow can run and update the file name?  For example I need the button to either add an Y_ or an X_ in the beginning of the name. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello Team,

 

Worked for me

 

yashkamdar_0-1599862892440.png

 

 

Expressions are -

 

 

True part of Logic

concat(outputs('Y'),outputs('GrabFileName'))

 

False part of Logic

@{concat(outputs('X'),outputs('GrabFileName'))}

View solution in original post

9 REPLIES 9
Super User II
Super User II

Hello Team,

 

I can help you with an option that will help you achieve this-

 

There is a Power Automate trigger called For a  the Selected file which is almost as good as a button in itself.

 

So this is how I can start the below flow (solution for appending Y_ before the name of the file) for a selected file-

 

yashkamdar_3-1599859383751.png

 

 

 

Flow structure -

 

Trigger is For a selected file.

 

Post that GET FILE PROPERTIES to grab the name of the file and a COMPOSE action where the grabbed name if added.

 

Another COMPOSE action which is populated with Y_

 

yashkamdar_1-1599859188549.png

 

Now, UPDATE FILE PROPERTIES action to update the Title of the File with the magical expression that appends data of Compose 2 action i.e Y_ in front of data of Compose action i.e Name

 

concat(outputs('Compose_2'),outputs('Compose'))

 

yashkamdar_2-1599859258610.png

 

FINAL OUTPUT - 

 

yashkamdar_0-1599859070033.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Hello @yashkamdar 

 

Thank you for the reply. So I created the flow with an if statement the flow runs but does not update the file name 😞 

 

Here is my config

AndoLalayan_0-1599861211251.png

 

AndoLalayan_1-1599861242247.png

AndoLalayan_2-1599861262460.png

 

AndoLalayan_3-1599861336854.png

 

The expression used for If yes 

concat(outputs('Y'),outputs('GrabFileName')) 

 
 

The expression used for If No 

concat(outputs('X'),outputs('GrabFileName')) 

 
 
 
 
 
 
 

Hello Team,

 

Let me quickly create a flow and help you out, I see you have done some changes but dont worry I will be back with an answer in the next 10 minutes

 

@yashkamdar sorry to be annoying about this I also was wondering if this can be a button in a new column on the document library so the user doesn't need to click extra buttons to run the flow? If not thats ok also just wondering. 

Hello Team,

 

Worked for me

 

yashkamdar_0-1599862892440.png

 

 

Expressions are -

 

 

True part of Logic

concat(outputs('Y'),outputs('GrabFileName'))

 

False part of Logic

@{concat(outputs('X'),outputs('GrabFileName'))}

View solution in original post

@yashkamdar its runs successfully for me also and it says it did it but when going to the document library noting changed. 

Hello Team,

 

Are you available on SKYPE, lets sort this over a screenshare.

I am on skype or teams. 🙂 

 

@yashkamdar 

Hello Team,

 

My Skype name - live:ykamdar3

 

By the way, I figured out the issue, you are updating the TITLE and not the NAME, you need to go to the views in your library and tick the title column to appear in the default view.

 

If this is not clear ping me on SKype we will solve it over screenshare

 

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!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

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 (46,793)