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

Update 2 share point lists (List A,List B)) at a time using a single form with is connected to List A in PowerApps.

Hai @WarrenBelz , @Amik 

 

Good morning

 

I have a situation where i have to update a 2 SharePoint Lists at time from Power App.

List A: Contains all the Unique Machine details with Columns :  Machine name, Machine MaintenanceStatus, Machine maintenence Date etc.

List B: Contains almost similar columns what LIST A had.

 

I have connected to List A from power app form to alter the Machine MaintenencStatus & MachineMiantenence Date as per my maintenance schedule. When ever i do that, ListA will get updated but i don't have any data collected to see the history of changes.

So i have created LIST B to maintain the historical changes of Line items in LIST A.

Please help me with the Solution  how to Patch to LIST A & List B at a time from a form with is connect to List A.

or suggest me any better way to do this !..

 

Hope you understand my Problem, if you need any further details i will provide you.

 

Awaiting for your reply.

 

Regards.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Amik
Super User
Super User

@ravi123 - firstly please remove one field from the Patch and then click the SubmitForm button again, keep doing this until there is no longer an error message. You can then identify which field or fields are causing the problem (looking at your code, I suspect it is the "MaintenanceStatus" field).

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

View solution in original post

Hai @Amik 

 

I got the Solution. i have tried the below patch( logic) and it's worked for me.

ravi123_0-1714377355503.png

Now i'm able to patch all the required columns to the ListB Using a form control with is connected to the ListA.

 

Thanks for your Suggestions giving so far.

 

Note: I got this logic from ChatGPT.

 

 

View solution in original post

9 REPLIES 9
vkondreddygari
Helper II
Helper II

When you SubmitForm to save changes for LIST A, onSuccess property of Form control, you can use patch function to insert row into LIST B with required values(with use of Form.LastSubmit) 

Amik
Super User
Super User

@ravi123 - On the OnSucess property of your Edit Form control, you can use the Patch function to create a new record in List B if any of the Controls in any DataCard are changed from their default values. Assuming the data types are the same across both lists, a simple way to do this is to leverage the Update property of the DataCard.

 

Example below:

 

Patch(
    'List B',
    Defaults('List B'),
    {
        Title: Title_DataCard1.Update,
        'Column 1': 'Column 1_DataCard2'.Update,
        'Column 2': 'Column 2_DataCard3'.Update
    }
);
Notify("List B Updated",NotificationType.Success)

 

 

 

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hi Amik

Thanks for your reply!

 

As you said, I have written Patch function to create a new record in List B to Onsuccess property of Edit form which is connect to ListA. But after submitting my form i see the updates in ListA but no record is created in ListB. Even i dont see any errors in the Formula. 

ravi123_0-1713942126408.png

My List B attributes are as follows. same as ListA. 

ravi123_1-1713942345136.png

Even i tried to use this Patch function in submit button of form control (List A),but it's thrown me an error called "Network error when using patch function. the request operation is invalid."

ravi123_2-1713943009241.png

 

 I don't know where i went wrong, could you please assist me.

 

thanks. 

Amik
Super User
Super User

@ravi123 - for an Edit Form control you need to use the SubmitForm function to create/update the record in List A. You will only use the Patch function on the OnSuccess property to create a record in List B.

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hai @Amik 

Even after using Patch function on the OnSuccess of List A to create record in List B still I'm getting an error called The Request Operation is Invalid.

Can you please help me further to get it done.

ravi123_2-1714217981415.png

 

My form Submit button.

ravi123_1-1714217895383.png

 

Thanks!

Amik
Super User
Super User

@ravi123 - firstly please remove one field from the Patch and then click the SubmitForm button again, keep doing this until there is no longer an error message. You can then identify which field or fields are causing the problem (looking at your code, I suspect it is the "MaintenanceStatus" field).

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hai @Amik 

 

I got the Solution. i have tried the below patch( logic) and it's worked for me.

ravi123_0-1714377355503.png

Now i'm able to patch all the required columns to the ListB Using a form control with is connected to the ListA.

 

Thanks for your Suggestions giving so far.

 

Note: I got this logic from ChatGPT.

 

 

Amik
Super User
Super User

@ravi123 - I am surprised you have marked your own response as the solution here. The answer to your question is to apply a Patch function to the OnSuccess property of your Edit Form control (which you did not know to do
until I advised you).

 

The Patch function not working for you is an entirely separate problem.

 

Please be mindful of this in future, because you are effectively getting solutions from community users but then taking the credit. This can discourage other community users from offering their expertise.

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hai @Amik 

Good Morning

 

Since i'm literally new to this community, i thought accept as a Solution means what is the logic that worked for me in our entire conversation. May be in future someone faced the same issue and if they search here and get into appropriate solution as marked by me or you . this is only the intention behind marking as a solution. 

Believe me , i really don't know what credit i will get by clicking on Accept as a Solution.

 

i'm very happy that the help you did for me, hope i will continue to get support from this community.

 

Thank you @Amik !!

 

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

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: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile 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. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros 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! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

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  

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