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 / OnChange to update sha...
Power Apps
Answered

OnChange to update sharepoint listitem

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello trying to make a TextInput display a current value from a sharepoint list item, 

 

But i want user to be able to simply click on input and type something new in or add to it. Due to the way i am checking for the record - i would like to display by default the current record text ( comments ). 

 

I tried to edit the OnChange field to use an UpdateIf and Match to compare and find the correct record - but it does not like the way I am doing this. Anyone able to help here? i am kind of stumped. Need to make sure the current label is also the same "trailer record" that its updating so this data follows the trailer if it moves location.

 

johnc222_0-1622839115081.png

OnChange

UpdateIf('Trailer Tracking', Match('374B1TrailerLabel'.Text,Trailer.Value), Comments.Text = '374B1Comments'.Text);

Default

 LookUp('Trailer Tracking', Building.Value = "374" && Dock.Value = "B1" && '374B1TrailerLabel'.Text = Trailer.Value, Comments)

 

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at
    UpdateIf('Trailer Tracking', Match('374B1TrailerLabel'.Text,Trailer.Value), {Comments.Text = '374B1Comments'.Text});

    You need to write the filed you are updating in curly bracket

  • Verified answer
    WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @Anonymous ,

    Are you simply trying to update the current record with the new comments?

    UpdateIf(
     'Trailer Tracking', 
     Trailer.Value='374B1TrailerLabel'.Text,
     {'374B1Comments':Comments.Text}
    }

    You can also use Patch

    Patch(
     'Trailer Tracking', 
     {Trailer.Value:'374B1TrailerLabel'.Text},
     {'374B1Comments':Comments.Text}
    }

    I am assuming here Trailer is a Choice field (not a Lookup)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi WarrenBelz,

     

    It appears both of those snippets are still showing as an error. Yes - i want it to compare the value the trailer currently showing in dock B1 is the same record in the sharepoint list - then change the comment text string if user types anything in the text input

     

    johnc222_0-1622849654512.png

     

  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @Anonymous ,

    What type of field is Trailer? I was simply using the values you posted (the syntax is correct for both the Patch and the UpdateIf). If it is a Text field, you do not need the .Value.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes Trailer is choice, believe it is also index'ed so there are no duplicates. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Looks like for the UpdateIf it only has the Comments.Text underlined. I thought this is correct as it is just a single line of text 

  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @Anonymous ,

    What does the error say?

  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 528

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard