cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Perform actions on a specific workbook selected from a file.

Greetings!

 

My situation is below which I have simplified because I have been able to design a flow that accomplishes most of what I want. I'm trying to simplify it.

 

I have 7 pre-built Excel workbooks stored in the same folder. Every month on the same day, I do the same exact five steps (see below) on all 7 workbooks.

 

The process would look like this:

Step 1) Open folder

Step 2) Open Excel workbook #1

Step 3) Refresh entire Excel workbook #1

Step 4) Print to PDF tabs 1 to 10, and tab 15 and 20.

Step 5) Close Excel workbook #1

Repeat Steps 1 to 5 (exactly as above) for Excel workbook #2, Excel workbook #3, Excel workbook #4, Excel workbook #5, Excel workbook #6 Excel workbook #7.

 

I have been able to build my flow so that it opens to any workbook I want and execute steps 1 through 5 above. My flow is very messy though because it consists of several subflows. Each sublfow uses the same "If then" and "Else if then" conditions to execute the same five steps.

 

I started with building 7 separate flows for each workbook and then I combined them all into one flow via the "If then" and "Else if then" conditions.

 

My question:

Since I have combined all 7 flows into 1, is there a way to tell my flow once from the beginning "Hey execute steps 1 through 5 for me regardless of if I open workbook #2 or workbook #6"?

 

Put another way: "If I chose workbook #1 OR workbook #3 OR workbook #5 perfom steps 1 to 5".

 

My goal is to simply the subflows so that it doesnt have the same "If then" and "Else if then" conditions on every subflow. I want the flow to excute steps 1 through 5.

1 ACCEPTED SOLUTION

Accepted Solutions

Not to my knowledge; however, if those 7 names are always the same, you can just list them manually:

MichaelAnnis_0-1627490942550.png

When ran, I selected workbook 4, and that still made the same %SelectedIndex% = 3, that we would expect from the previous version.



----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.

View solution in original post

15 REPLIES 15
MichaelAnnis
Super User
Super User

If all 5 steps are the same for all 7 workbooks, I would have 1 set of subflows, and on my main would look like this:
"Get Files in Folder" to %Files%

"ForEach" CurrentItem in Files:

Do all Subflows

 

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

Thank you for the reply! I appreciate you taking the time to assist me. Would you mind posting a screen shot of what this would look like as I am still learning how to use PAD?

MichaelAnnis_0-1627078336518.png

When creating your subflows, make sure any time you have to point to the "filename", you point to the variable %CurrentItem%.  Example - Launch Excel:

MichaelAnnis_1-1627078415893.png

If you are using Windows UI Elements, make sure the selector is generic enough to incorporate all workbooks, for example the Refresh Button:
Let's say your 7 spreadsheets were all titled Month End Close 1 (2, 3 and so on).  When you first capture the UI element, the selector will be to Month End Close 1.xlsx only.  You can change this, so that it will be captured on all of them, and you don't have to select each separately. Follow these steps:

1) Go to your UI Elements (in the top right):

MichaelAnnis_3-1627078772194.png

2) Hover the mouse over the "Window" Selector, and left click the 3 dots

MichaelAnnis_4-1627078863636.png

3) Left click "Edit Selectors"

MichaelAnnis_5-1627078918101.png

4)Hover over the text displayed, and click the 3 dots again

MichaelAnnis_6-1627078950314.png

5) Left Click "Edit Selector"

MichaelAnnis_7-1627079097076.png

#6 was edited 7.26.21

6) Look for the "Name" box, and manually edit the text under value to something that incorporates all the excel files.  For my example, that would be "Month End Close" and then change the "Equal To" operator to "Contains".

 

If you have any trouble, let me know.

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

Thank you for this information! I appreciate it. This makes sense but one thing I would like the flow to have is a Display Dialog Box that allows the user to pick which file they want to run the flow on and then have the flow run the sub-flows based on their selection. The subflow actions are all the same regardless of which file they want to run the flow on. Where would I incorporate that into the flow? Below is a screenshot of my current flow. As you can see, the Display Dialog Box will open, the user selects which file from the drop-down menu and then I have several If and Else If conditions performing the same action. How can I use a loop like you have shown me above, to run each subflow based on what the user selects from the drop-down men?

 

gordo_c_123_0-1627233781487.png

 

If you only want 1 workbook ran at a time, I would use a dialog box to establish the workbook.  I am not at my computer, so I can’t check, but if dialogue box has a drop down option, I would use that; otherwise, you could use a number input to dictate which workbook. Then you can define the workbook as a variable based on the selection. To do this, you would use  the “Switch” and “Case” commands to define the workbook variable based on the user selection.

 

If you want more than 1 workbook ran as an option then I would add a True/False dialog box for each workbook, so they could select only the ones they want ran. Then have the bot say “If true, add file to list” for each dialog box variable, and then loop through the workbooks as we had discussed before. 

Good luck.

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

Would you be able to provide me with another screenshot of what that would look like? I tried following along but I dont think my actions are ordered correctly.

Get files to the list %Files%

MichaelAnnis_0-1627423167507.png

In Display "Select List from Dialog", you have them choose from the list of files.

MichaelAnnis_2-1627423210589.png

This is what it will look like for the user...they simply check off the workbooks they want to run:

MichaelAnnis_4-1627423493641.png

Then you set up the For Each item in %selectedindexes%...for my example, this would be [0] and [1].

That will give you "Current Item", so it will run [0] first, and then [1] second in my example.

For Launch Excel, tell it %Files[CurrentItem]%, so the first time, it would be Files[0] and the second time, it would be Files[1].

MichaelAnnis_3-1627423233257.png

 

Good luck.

 

 

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

Beautiful - you are such a great help! Sorry but I have one last question: is there a way to rename the list of files in the drop down so that it would show something easier to read like "Workbook #1", "Workbook #2", etc instead of the file paths?

 

I also do not want to give the user the option to select more than one file to open. When I adjust that setting in the Display Select from list dialog box, I get an error message. Any fix for that?

 

Would I have to create input variables with the file path and then set variable with the name i want?

Instead of %Files% in the dialog box, try %Files.Name%.

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

Not sure what you mean by that, could you clarify?

 

Instead of running this as a loop, I need it to run once. I want the user to have to choose to run another workbook which would execute the same actions and I accomplished this by using an If condition. I'm almost there: see screenshot below to see what my workspace looks like.

 

Workspace set up:

gordo_c_123_1-1627486947710.png

 

Display Select from list dialog which is where the drop-down menu comes in:

gordo_c_123_1-1627485256304.png

 

My If condition:

gordo_c_123_2-1627485345680.png

 

Finally, my Launch Excel action:

gordo_c_123_3-1627485377327.png

 

This set up gets me to where I want to be: grabs the folder files, displays a drop-down menu of files to choose from, the user clicks on which ever file they want, and it opens the excel workbook.

 

Now the only remaining issue I have is: below is a screenshot of what the drop-down menu options look like. Long ugly file paths. How can I get the drop-down menu to display a clean looking name such as "Workbook #1, Workbook #2, Workbook #3, etc." instead of a list of file paths?

 

Screenshot (4)_LI.jpg

 

 

Adding ".Name" after Files[#] will pull in only the file name and not the whole path:

MichaelAnnis_0-1627489915365.png

 

The allow multiple selection box will determine if you allow them to run 1 workbook or multiple workbooks.  If you are only running 1 workbook, then you don't need a For Each nor an If statement.  Simply do a Launch Excel opening the selected index:

MichaelAnnis_1-1627490075289.png

If you are all done, please thumbs up and accept as solution the best response that answers the original question.

Thank you



----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

Adding the .Name" after Files[#] works but is there a way to drop the file name extension? In this case, is there a way to remove the ".xlsm" from the drop-down menu?

Not to my knowledge; however, if those 7 names are always the same, you can just list them manually:

MichaelAnnis_0-1627490942550.png

When ran, I selected workbook 4, and that still made the same %SelectedIndex% = 3, that we would expect from the previous version.



----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
Anonymous
Not applicable

That didnt work for me but that's ok. We got close enough. Thank you again for your assistance! I sincerely appreciate you taking the time to help me with this!

@Anonymous , this came across my feed, and I have an update. There is a property called “.NameWithoutExtension”. I think this is what you were looking for. 

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!   Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪 🌠  

Tuesday Tips: Community Ranks and YOU

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!This Week: Community Ranks--Moving from "Member" to "Community Champion"   Have you ever wondered how your fellow community members ascend the ranks within our community? What sets apart an Advocate from a Helper, or a Solution Sage from a Community Champion? In today’s #TuesdayTip, we’re unveiling the secrets and sharing tips to help YOU elevate your ranking—and why it matters to our vibrant communities. Community ranks serve as a window into a member’s role and activity. They celebrate your accomplishments and reveal whether someone has been actively contributing and assisting others. For instance, a Super User is someone who has been exceptionally helpful and engaged. Some ranks even come with special permissions, especially those related to community management. As you actively participate—whether by creating new topics, providing solutions, or earning kudos—your rank can climb. Each time you achieve a new rank, you’ll receive an email notification. Look out for the icon and rank name displayed next to your username—it’s a badge of honor! Fun fact: Your Community Engagement Team keeps an eye on these ranks, recognizing the most passionate and active community members. So shine brightly with valuable content, and you might just earn well-deserved recognition! Where can you see someone’s rank? When viewing a post, you’ll find a member’s rank to the left of their name.Click on a username to explore their profile, where their rank is prominently displayed. What about the ranks themselves? New members start as New Members, progressing to Regular Visitors, and then Frequent Visitors.Beyond that, we have a categorized system: Kudo Ranks: Earned through kudos (teal icons).Post Ranks: Based on your posts (purple icons).Solution Ranks: Reflecting your solutions (green icons).Combo Ranks: These orange icons combine kudos, solutions, and posts. The top ranks have unique names, making your journey even more exciting! So dive in, collect those kudos, share solutions, and let’s see how high you can rank!  🌟 🚀   Check out the Using the Community boards in each of the communities for more helpful information!  Power Apps, Power Automate, Copilot Studio & Power Pages

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

Top Solution Authors
Users online (5,675)