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

Patch Function to Update the whole list with a button

Hi,

 

I'm building this app and would like to update the whole list in sharepoint with one button. From my searches Patch Function can do it. My Challenge is I'm using flows to send text messages and the trigger event is the Sharepoint List being modified and with a IF condition met. I would like to set the variable involved in the Flow IF Condition with the the Patch function so I apply that varaible to the whole list at once and it's blasts and email.

 

Any Ideas.

 

Thanks!

8 REPLIES 8
v-monli-msft
Community Support
Community Support

Hi @drallam2,

 

If you mean that you want to pass variable from Flow to PowerApps, then I'm afraid that this cannot be achieved so far. Please consider to post an idea in the PowerApps Ideas forum, so it might be considered for future releases.

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

If my understanding is incorrect, please feel free to tell.

 

Regards,

Mona Li

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-monli-msft I meant the other way around. Sorry for not explainning it correct. I want to pass variable from Powerapps to update the Sharepoint list and once there's a change in Sharepoint, Flow can be triggered.

I'm struck at how to update the whole list in sharepoint with a button in Powerapps.

 

I hope this helps you understand the problem

 

Thanks! 

Anonymous
Not applicable

@drallam2 --

I don't get why you think Patch() is required to do what you want to do. Assuming the trigger for the Flow is an update of the Sharepoint List, then Patch() isn't required since both these functions, Patch() and SubmitForm(), both do updates.

 

In the event that you need some data from PA for the Flow, it's trivial to just add in some code after the SubmitForm() call. Something like this on the OnSelect or OnSubmit property (Not entirely sure which):

SubmitForm( ... );
ThatFlowYouWant.Run()

Also -- in case you didn't know, if you add a parameter called "Ask in PowerApps" in your Flow, that Flow automatically becomes a possible connector for PowerApps. Although, you would still need to manually add it to your app. 

 

P.S. SubmitForm() is the default submission method for templates. It definitely takes away the complexity but in sacrifice of control. For most part, there have been improvements with Sharepoint - PowerApps collaboration, so there's most likely no need for Patch() unless you have very specific requirements.

Anonymous
Not applicable

Oh. Now that I've read your post again -- it seems that you aren't aware of forms in PowerApps (or I might be wrong and somewhat hallucinating). 

 

Tip: Forms in PowerApps had recent improvements to work with Sharepoint Lists. i.e. You can create a Form object, set the DataSource property to your Sharepoint List connector, and PA will automatically build the forms and submission methods for you. That SubmitForm() I was talking about? It'll add that automatically too. 

 

Another tip: Don't snooze and type. Lol.

@Anonymous  Thanks for reply. So I use Forms and submit form to update my Sharepoint list. The challenge is although the person makes the change, he/she will see a overall summary of the changes more like a preview and if he/she doesn't like the hanges they will change it again and when they are happy with the results. The final step is to hit the button (in powerapps) which blasts out text messages per line in the sharepoint list based on a condition in Flow  (if Column "A" value ="SEND") then the Flow triggers.

 
Is there a way to update a "Single Line Type" column" A" in sharepoint list from powerapps with "SEND" for the whole list at once? And as you said is Patch() even suitable for this operation?

Anonymous
Not applicable

@drallam2 --

To be honest, I have no idea what you want to do with PowerApps. You lost with the blast and everything after that.

 

Here's what I sort of got. Listed below is the flow you want to go with (Not MS Flow):

  1. User goes to EditForm in PowerApps and adds changes
  2. User clicks on Submit Button. The form doesn't apply the changes immediately but directs the user to a summary page of sorts, asks User to confirm presented changes.
  3. If User is not happy, go back to Step 1. If otherwise, ???.

 

Let's backtrack since we seem to hold different assumptions...

  • Is the Edit Form only for a single record? If so, what's with the text message per line?
  • Are you trying to edit a bunch of records/rows at once?
  • If you can and want, can you describe your data structure (i.e. your tables, columns, etc.) here.

 

@v-monli-msft -- He seems to have mistyped in first post. We might need your help in this one.

Anonymous
Not applicable

@drallam2 --

Sorry. I was being stupid. I understand your first post in this thread better now.

 

So, one thing -- You can't just use Patch() to update multiple records. What you can do, however, is use Patch() together with ForAll()In something like this:

ForAll( RenameColumns( YourDataSource, "ID", "LoopID" )
    Patch( YourDataSource, LookUp( YourDataSource, ID = LoopID ), {
        // New values and such.
    }
)

Although, I haven't really needed this exact function for mine so it would mostly likely need some tweaking. I'm tagging @hpkeong since dealt with this thing before.

HI @Anonymous 

 

Sorry for getting on this so late. Let me explain the last part. I wanted to trigger a MS Flow based on items being modified in a shrepoint list. The MS flow sends the text messages to a group of people (each one of the Sharepoint list) at once.

 

What I want to do with Powerapps is use it as an interface to modify the sharepoint list and also to trigger that MS Flow as mentioned above.

Yes the steps which you listed is excatly how i'm envisioning the app to be used.

  1. Editform in powerapps and add changes (in Database1)
  2. The user sees a preview of the submitted changes (in Database1)
  3. If user not happy editform in powerapps again (in Database1)
  4. If user is happy with the changes, hit a button in powerapps, adds a "SEND" text value to a particular column (SingleText Type) (in Database1)
  5. That "SEND" value trigger the MS Flow and sends a text to every body.

 

Helpful resources

Announcements

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip: Community User Groups

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: Community User Groups and YOU Being part of, starting, or leading a User Group can have many great benefits for our community members who want to learn, share, and connect with others who are interested in the Microsoft Power Platform and the low-code revolution.   When you are part of a User Group, you discover amazing connections, learn incredible things, and build your skills. Some User Groups work in the virtual space, but many meet in physical locations, meaning you have several options when it comes to building community with people who are learning and growing together!   Some of the benefits of our Community User Groups are: Network with like-minded peers and product experts, and get in front of potential employers and clients.Learn from industry experts and influencers and make your own solutions more successful.Access exclusive community space, resources, tools, and support from Microsoft.Collaborate on projects, share best practices, and empower each other. These are just a few of the reasons why our community members love their User Groups. Don't wait. Get involved with (or maybe even start) a User Group today--just follow the tips below to get started.For current or new User Group leaders, all the information you need is here: User Group Leader Get Started GuideOnce you've kicked off your User Group, find the resources you need:  Community User Group ExperienceHave questions about our Community User Groups? Let us know! We are here to help you!

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!  

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA

Top Solution Authors
Top Kudoed Authors
Users online (5,083)