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 / Issue patching a form ...
Power Apps
Unanswered

Issue patching a form to a collection with SQL as the source

(0) ShareShare
ReportReport
Posted on by 437 Super User 2024 Season 1

I have a small form with just 5 columns.  The form gets it's data from a SQL table via "value" settings on each Text Input field (modern controls).  I'm trying to patch form changes to a collection but when I make changes, the collection shows the SQL data, not the data I changed on the form fields.

 

Also, my UpdateIf statement says ".value" and ".Checked" are not right

 

If(IsBlank(LookUp(colPassesUpdates,PassId = ThisItem.PassId)),Collect(colPassesUpdates,ThisItem));UpdateIf(colPassesUpdates,PassId = ThisItem.PassId,{PassType:PassType.Value,PassFee:PassFee.Value,Duration:Duration.Value,Active:Active.Checked})

 

The PassId field is not editable via the form as it's the UniqueID in SQL.

Categories:
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @Brian-M 

     

    One possible reason why your collection shows the SQL data instead of the data you changed on the form fields is that you are using the value property of the text input controls, which is bound to the SQL data source. To patch the changes made by the user, you need to use the text property of the text input controls, which reflects the user input. For example, instead of using PassType.Value, you should use PassType.Text.

     

    Another possible reason is that you are using the UpdateIf function incorrectly. The UpdateIf function takes three arguments: a collection, a condition, and a record. The record argument should be a single record, not a list of records. You are using curly braces {} to enclose your record argument, which creates a list of records instead of a single record. To fix this, you should use parentheses () to enclose your record argument. For example, instead of using {PassType:PassType.Text}, you should use (PassType:PassType.Text).

     

    Here is an example of how to patch your form changes to a collection using the text property and the parentheses:

    If(IsBlank(LookUp(colPassesUpdates,PassId = ThisItem.PassId)),Collect(colPassesUpdates,ThisItem));UpdateIf(colPassesUpdates,PassId = ThisItem.PassId,(PassType:PassType.Text,PassFee:PassFee.Text,Duration:Duration.Text,Active:Active.Checked))
    

    I hope this helps you solve your problem.

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Brian-M Profile Picture
    437 Super User 2024 Season 1 on at

    I understand what you're saying.  However, when I apply that, I get an error:

     

    BrianM_0-1697030905565.png

     

    Also, ".Text", ".Checked" and ".Value" are not parameters that seem to be available.  It always throws an error when I type any of those, such as "PassFee:PassFee.Text".  .Text is always underlined with an error.

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard