cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AW
Advocate II
Advocate II

Save data from multiple screens to submit

How can I save data from fields across multiple screens to submit as one entry? For example, I can use an Edit Screen to submit a form with 5 fields. I'd rather have a flow with detailed explanations so each field (or two) is on separate screens. I can create a button to the next screen, but how do I save the data from each field/screen and submit all fields at once? Or (and on a related note), if I have to submit each field at at time, how do I append the data to the same record?

21 REPLIES 21

How many  input fields do you have? For three input fields the expression is still very compact:

Patch(MyDataSource, Defaults(MyDataSource), {MyTextColumn: TextInput1.Text, MyNumberColumn: Value(TextInput2.Text), MyOtherColumn: TextInput2.Text})

There is no limit that I have yet met for characters in a PowerApps expression, my longest one to date is probably a about a thousand characters.

 

Can't comment on the roadmap as I am a simple user...

Anonymous
Not applicable

Thanks.  Well the form I'm currently considering has at least 20 fields.  I've decided to use Forms, with the Updates syntax of Patch.  My data source are SharePoint Online lists.  There is a main "parent" list and several "child" lists.  It took me a while, but I firgured out a way to use the Patch function to import a default value of a "key" field in the parent form into its counterpart in a child form.  So solutions involving Patch (rather than SubmitForm, EditForm, etc.) are of particular interest to me in developing apps of this type.

Colinl, can you please share your Patch code. I am still having problems wit my Sharepoint list.

Thanks in advance.

 

Erwin

Anonymous
Not applicable

Sure.  Not sure if the below will make complete sense to you (I've tried to be generic), but it assumes a "Creator Form" to initialize a new parent form record; the "Parent Form" itself for data entry; the "Child Form Screen" that has a "Child Form" to add rows to a "Child Gallery List" on the same screen; and a "Browse Gallery List" for the created parent records.  Sorry for any typos.  Still a work in progress ...

 

OnSelect code for Button to Open Parent Form Screen
===================================================
Refresh(<SPParentList>)
; ResetForm(<ParentFormName>)
; Patch(<SPParentList>, Defaults(<SPParentList>), <CreatorForm>.Updates)
; Navigate(<ParentFormScreenName>, Fade)
; NewForm(<CreatorForm>)

 

OnSelect code for Button to Open Child Form Screen
==================================================
NewForm(<ChildFormName>)
; Navigate(<ChildFormsScreenName>, Fade)

 

OnSelect code for Button to "Save and/or Submit" Parent Form
============================================================
If(<CreatorForm>.Mode = New
, Patch(<SPParentList>
, First(Filter(<SPParentList>, ID = Value(<ParentKeyDataCardValueNumber>.Text)))
, <ParentFormName>.Updates
)
; Navigate(<AfterSubmitScreenName>, Fade)
, Patch(<SPParentList>
, <BrowseListGalleryName>.Selected
, <ParentFormName>.Updates
)
; Navigate(<BrowseListScreenName>, Fade)
)

 

OnSelect code for Button to Save new line to Child Gallery
==========================================================
Patch(<SPChildList>, Defaults(<SPChildList>), <ChildFormName>.Updates)
; Refresh(<SPChildList>)

 

OnSelect code for Button to Return to Parent Form Screen
========================================================
Navigate(<ParentFormScreenName>, Fade)


OnSlect code for button to "Cancel" the newly created parent record
===================================================================
If(<CreatorForm>.Mode = New,
RemoveIf(<SPParentList>, <ParentKeyDataCardValueNumber>.Text = ID)
; RemoveIf(<SPParentList>, <ChildKeyDataCardValueNumber>.Text = <SPChildListKeyField>)
; Navigate(<AfterCancelScreenName>, Fade)

, Navigate(<BrowseListScreenName>, Fade)

)

Great!! This definitely makes sense.

Thanks

 

tianaranjo
Continued Contributor
Continued Contributor

@murali  -- Hoping to revisit this solution.  I have a similar need, submit data from multiple screens on a New form.  I implemented the solution from this post, (shown below), and wanted to check if this is a reasonable solution.  This is working for me with a new entry -- where in the original message, you discussed using the Updates for an item being edited. 

 

My questions then is -- is this a viable solution for submitting a new form collected from multiple screens?  Or should I use Patch?

Patch('Datasource',Defaults('Datasource'),
frmAddNew.Updates,frmAddNew_2.Updates, frmAddNew_3.Updates, frmAddNew_4.Updates, frmAddNew_5.Updates)

Hi

I have a similar setup - but I am approaching it slightly differently.  I have a table with about 50 fields that, depending on specific fields, are then split into screens for form entry.  Can you share how you would do the Patch function for 20+ fields in one table (for a new entry)?  So far I have 

Patch( MyTable, Defaults( MyTable), ...)

How would I implement an Update in the Patch function for the different screens that contain fields in the table?

Hey realik,

 

So I don't exactly understand your question but I think I can help. The way I see it you have a table with 50 columns. You desire to create a new entry for 20 or more of these columns (fields) at a time right? I think you have a few options. 

 

You could just use a collect function. It won't update already created rows, but it doesn't sound like you need that. I am writing this assuming that your users are using things like text input boxes and drop down menus to enter their information. I think it would look like

Collect(MyTable,{TextInput1: TxtInpt1.text, DropDown1: DrpDwn1.Selected.Value, TextInput2: TxtInpt2.Text, .... })

Where TxtInpt1 is the name of the text input box that the user would enter the information you desire in the TextInput1 column. Collect can collect information across screens.

 

Your second option is very similar, just use the patch function. I believe you have it written correctly already, just need to fill in the column links.

 

The last option I can think of involves edit forms. One thing I have done is set up a screen, S1, and on S1 there are just text input boxes and drop down menus. Then I set up a asecond screen, S2, which contains and Edit Form. I put every single column into this Edit Form, so essentially it is a really long edit form with every field in it. Then I change the update field of each data card to the name of the corresponding text box from S1.

 

It would go like this. You have the text box TxtInpt1 on S1. You have the TextInput1 data card on S2. Set the TextInput1 data card's update value to TxtInpt1.text. Now when you SubmitForm(EditForm1) you will find the information from TxtInpt1 in the TextInput1 column in your database.

 

You could have one screen for each column (field) if you wanted to, it doesn't matter as long as you set all of the data card's update fields correctly.

 

I have used each of these methods succesfully in my own apps, so I believe they could work for you as well. I hope this helped.

Thank you for the response! 

 

I have created the command for submitting 3 forms for a new entry intio a single sharepoint record (multiple fields on each form) as follows:

 

OnSelect = SubmitForm([@NewForm1]);Patch(TracsBatchJobs,NewForm1.LastSubmit,NewForm2.Updates,NewForm3.Updates);SubmitForm([@NewForm3]);Navigate(BrowseScreen1, Fade)

 

It was almost working - but seems to have broken when I copied the submit...I say almost because it would submit but it would submit 2 records...one for form 1 & 2 and then one for form 3 (so I would have 2 entries...

 

Suggestions? 

Hey realik,

 

I've been experimenting with submitting two seperate forms as one sharepoint list entry and I have not had much success using actual forms. The method using Collect(), Patch(), and regular text boxes I described earlier worked fine. 

 

From first glance I can tell that your equation contains two different SubmitForm() statements, so essentially you are submitting two different records. I believe this is why two records would be created. Remove that second SubmitForm() and see what happens.

 

I hope this helps.

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 3rd, 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
Top Kudoed Authors
Users online (4,928)