web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Seeking to go from Goo...
Power Apps
Answered

Seeking to go from Good to Great - Using Patch function OnChange of user inputs

(0) ShareShare
ReportReport
Posted on by 20

Hello!

 

So I created my fist app! It is actually pretty simple. In short, it is a Microsoft form with some nice bells, whistles, and a different UI than MS Forms.

 

One of the things I did was leverage the out of the box "Help" screen that Powerapps offers. I then took this logic to create my Turbotax-like form experience.

 

The working version that I have as an MVP uses Patch for every user input OnChange. It is working just fine with only 1 error when I was testing quickly from input to input. So my main question is, how can I do this better? I feel like I am Patching the SharePoint list too often. Below is an example of the patch function, there are probably 50ish throughout the app.

 

If(IsBlank(rad_MI_Answer4.Selected.Value),"",Patch(Assessment,LookUp(Assessment,User().Email=user_email),{mi_answer_4:rad_MI_Answer4.Selected.Value}));

 

Anyway, looking forward to hearing your thoughts and please let me know if I can help articulate this better. I am a noob after all 🙂

Categories:
  • Verified answer
    mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @Joework 

     

    can you try this please:

    onchange of input field

    Collect(ChangesCollection, { Field: "mi_answer_4", Value: rad_MI_Answer4.Selected.Value, Email: User().Email });
    
    

    onselect of button:

    ForAll(ChangesCollection as Change,
     Patch(
     Assessment,
     LookUp(Assessment, User().Email = Change.Email),
     { mi_answer_4: Change.Value }
     )
    );
    Clear(ChangesCollection);

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

     

  • CU23082138-1 Profile Picture
    20 on at

    Hi @mmbr1606 

     

    Thank you for this solution! It looks like it will certainly reduce the number of times I am patching my SP list. In general, do you feel this approach is best practice?

     

    Also, can you help describe what this code does? Here is my assumption. You are collecting the inputs from the user each time they enter data and placing in a temp table / cache. Later on, once they click a button, all of the data collected to that point is patched to the SP list. 

     

    Did I get that right? It always helps me when I understand the "plain English" explanation of what is going on behind the scenes. Thanks!

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    Hey @Joework 

     

    I cant tell u if its best practice everybody would agree on xD but if it works it cant be bad i guess

     

    Short explanation:

    The combined logic of these scripts allows for a temporary collection of field changes tied to user inputs, which are then committed in bulk when a button is clicked. This can help optimize performance by reducing the number of direct writes to the data source and provides a way to batch process updates efficiently.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • CU23082138-1 Profile Picture
    20 on at

    Awesome! Thank you for your help. @mmbr1606 

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard