cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DCNehs
Post Patron
Post Patron

PowerApp button to run get items workflow from Gallery

Is it possible to use a button on a gallery to "get items"?  I have a regular workflow that functions when you are creating a new item but I'm hoping to add a button to a gallery so they can run it from there when they are ready to take care of that task.

 

I'd like it to look for 3 values (Dept, Center, Role) from another list that is connected to the powerapp and then send an email to the person working on the checklist the list of security groups they need to enter requests for.

1 ACCEPTED SOLUTION

Accepted Solutions
DCNehs
Post Patron
Post Patron

I wasn't able to figure out using collections and trying to place on the form (larger form) and I may have someone at work that might know a way.

 

For anyone interested, I WAS able to get the button working to run the workflow from the gallery item.  Note the quotes in front and back of the name of the workflow name and then it was just choosing those columns.

 

'UPTChecklistGetSecurityGroups'.Run(ThisItem.Department,ThisItem.Centers,ThisItem.Roles)

View solution in original post

17 REPLIES 17
jnernst
Advocate II
Advocate II

I think I might be able to help you out. Could you please elaborate more? Is this more of a Power Apps question? If so, connect your data source to the gallery that you desire. You can do this by clicking on the gallery item, it'll be a drop down on the right under properties. That will connect your gallery with your SharePoint list. Make three drop down boxes that target those three values that you want (Dept, Center, Role). You can make a button that utilizes the "Run" command and you can send your email to your coworker via Power Automate.

 

If you require further instruction, please let me know what I can do to help you out.

Otherwise, hit the like button so that others with your same issue know what to do.

 

 

I already have a list which is connected to the Powerapp and gallery.  The 3 cascading dropdowns are also connected through the secondary list which this workflow needs to pull from.  Maybe the cascading dropdowns is the problem?  This is my first time attempting trying to run a workflow from a canvas app.

 

I created the workflow from a video I found, but of course cannot find it again.  And then I'm unsure what to place in the "run" area in the workflow so i've just been taking guesses based on what i saw in the video.

 

this is the error.  Department seems to be looking at the Title, but even if i change it to title, it comes out the same way.

 

{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"Department eq 31and Center eq 10002059 - Engineering Officeand Role eq Director\" is not valid."}}}

 

Whatever I had next to run in the workflow is now completely erroring and doesn't work at all.

run.jpg

getsecurity.jpggetsecurity2.jpg

 

 

The Run command is calling to your Power Automate flow. You should put the name of your flow before run.

I.E. PowerAutomateFlow.Run()

I recommend you make your flow before you attach it in this way. Using the "ask in powerapps" It makes a call to each value that is required, this should make the syntax easier.

The action tab has a Power Automate Button that makes linking your Flow much much easier.

 

*A TIP* hover over the command you are using (In this case "Run") it will preview the syntax required for said command.

I have the name of the flow  Powerappsbuttongetsecuritygroups.Run()

Created the workflow before attaching but will try it again.  I was following what it was telling me to do when hovering which was asking for those 3 areas but it didn't want to take them.  

Wish they made this easier to figure out.

 

 

jnernst
Advocate II
Advocate II

I wish they did too. You need to ensure that your values are in the correct format. In some cases it won't accept values at all. Records and tables are very if-y. Try playing with your suffixes...

Powerappsbuttongetsecuritygroups.Run(ddDepartment.Selected.Text,ddCenter.Selected.Text,ddRole.Selected.Text)

or

Powerappsbuttongetsecuritygroups.Run(ddDepartment.Selected.value,ddCenter.Selected.value,

ddRole.Selected.value)

 

Try playing around with the suffixes, friend

 

Hi @DCNehs :

 

The point is that the value of 'DropdownName.SelectedText' is an Object but you needs three strings to pass to the flow.

vbofengmsft_0-1648619505755.png

 

Please try:

FlowName.Run(Dorpdown1.SelectedText.Value,Dorpdown2.SelectedText.Value,Dorpdown3.SelectedText.Value)

 

instead of 

 

FlowName.Run(Dorpdown1.SelectedText,Dorpdown2.SelectedText,Dorpdown3.SelectedText)

 

Best Regards,

Bof

 

ok, so I'm a little further along now.  Made those changes and it's running now.  I also noticed that i didn't have the single quotes in the filter which seemed to make a difference.

 

So now the workflow is running.  It shows success, but it's not pulling the actual information and just the default entries in Yellow.  I must be filtering incorrectly.  I tried adding a compose after the variables and they are only pulling -.  Any ideas? 

 

Thanks so much so far for everyone's input here.  This button is going to be super helpful for my folks.

 

groups.jpg

jnernst
Advocate II
Advocate II

Can I see your whole flow? It seems you are using the Run command... are you submitting your form or updating the entries otherwise in your PowerApps?

 

If not insert a ";" semi-colon on the end of your Run command.

Start a new line that says:

SubmitForm("FormName")

I was not aware there was anything else available than the run command.  First time running a workflow from PowerApps.

 

They will not be submitting or updating anything.  All of the information is already in the list item that the manager submitted.  The admin later will come back to the list item on the gallery  where I'm hoping they can just click on a button that says "get security groups" and it will look at the fields that the manager originally filled out, compare and look at the separate Security Groups list and send all of the groups associated with the "Department", "Center" and "Role" were chosen.

 

Get Items is looking at the secondary list with the actual security groups in it.

 

workflow.jpg

jnernst
Advocate II
Advocate II

Your table won't populate unless you tell it to... I am a bit confused on what you are trying to accomplish.

 

My apologies,

 

Josh

It's ok I'll keep playing with it and figure out it.  All of the information is there and already filled out. 

 

I still just want a button on the gallery to do the manual "Get Items" instead of forcing the Admin to go to the actual backend SharePoint list since that would be defeating the purpose of having them use the App.  

 

I created a simple manual PowerAutomate workflow to "get items" for someone to use on the actual list so I would  think there is way to get that to work through a button on PowerApps...but it's MS, so maybe maybe not.  Sometimes it's the simple things we have issues with.

jnernst
Advocate II
Advocate II

There is a way to do it, but I would've done it strictly through PowerApps... You can fetch data from all over on PowerApps. In my opinion, much easier to get working that Power Automate.

 

Set your two data sources within your App

Have two different Data Tables, one for each SharePoint list. (Or However you'd like to do it)

Connect the Fields to the tables accordingly, and you should have what you want.

 

PowerApps is a great tool.

I recommend getting familiar with it!

yeah, have been using it for a few years but not yet intermediate to advanced.   My customers aren't asking for any really crazy stuff.

They were asking for a button and so I'd like to accommodate that.  

 

If i can figure out how to pull them in with another cascading dropdown, I'll work on that later.  There is normally 1 or more security groups that would need to be pulled.  I don't know how to do that with a cascading dropdown in PowerApps.

jnernst
Advocate II
Advocate II

You would have to use a combo box if you wanted to make multiple selections... But that gets tricky. I would work on getting it to function one at a time first, then go from there.

 

To filter your queries and search specific things on your table do this:

 

OnStart Note.PNG

 On Start is a function under the three dots to the right of the "App" tree item.

All I am doing there is saying when the form starts up, I declared a collection name and chose what data source it is coming from (My SharePoint list)

 

Now make a data table. This is going to be where you'll preview your information.

Data Table Note.PNG

 

The Text Input box works as my search bar. Check out the code and make it work in your form! It's super useful, and it's not as complicated as it seems.

 

Best of Luck!

 

Josh

I haven't really worked with collections yet.   Sounds like a good time to learn about it. Thanks!

jnernst
Advocate II
Advocate II

Just an off screen way to refer to information. Syntax can be difficult. But very helpful, and again, not too difficult to use.

Let me know how it goes!

DCNehs
Post Patron
Post Patron

I wasn't able to figure out using collections and trying to place on the form (larger form) and I may have someone at work that might know a way.

 

For anyone interested, I WAS able to get the button working to run the workflow from the gallery item.  Note the quotes in front and back of the name of the workflow name and then it was just choosing those columns.

 

'UPTChecklistGetSecurityGroups'.Run(ThisItem.Department,ThisItem.Centers,ThisItem.Roles)

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (459)