cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sababneh
Advocate IV
Advocate IV

Missing data with Patch function

Hello,

 

I have a SharePoint list, and a Collection from it. And I'm patching both the collection and SharePoint list (for UI performance feel).

 

For some reason, the "Reason" column is updating on the SharePoint List, but not on the Collection. (While the Status is updating on both ways)

Collection patch:

Patch(
        recordsList,
        selectedCall,
        {
            Status: "Failed",
            Reason: Dropdown1.SelectedText.Value       
        }
    )

 
SharePoint List patch:

Patch(
        'Calls List',
        selectedCall,
        {
            Status: "Failed",
            Reason: Dropdown1.SelectedText.Value
        }
    )

 
Is there any way to troubleshoot this? I have tried putting a string instead of Dropdown1.SelectedText.Value, it worked once, then it stopped working.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Sababneh ,

I assume SelectedCall is a something selected in a gallery and set as as Variable?

Two things your might try here - if that data set contains an identifier such as an ID

Patch(
   'Calls List',
   {ID:selectedCall.ID},
   {
      Status: "Failed",
      Reason: Dropdown1.SelectedText.Value
   }
)

or

UpdateIf(
   'Calls List',
   ID=selectedCall.ID,
   {
      Status: "Failed",
      Reason: Dropdown1.SelectedText.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.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Sababneh ,

I assume SelectedCall is a something selected in a gallery and set as as Variable?

Two things your might try here - if that data set contains an identifier such as an ID

Patch(
   'Calls List',
   {ID:selectedCall.ID},
   {
      Status: "Failed",
      Reason: Dropdown1.SelectedText.Value
   }
)

or

UpdateIf(
   'Calls List',
   ID=selectedCall.ID,
   {
      Status: "Failed",
      Reason: Dropdown1.SelectedText.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.

Hello @WarrenBelz 

Thanks for the reply.

 

This code is working perfectly:

 

UpdateIf(
        recordsList,
        ID = selectedCall.ID,
        {
            Status: "Failed",
            Reason: Dropdown1.SelectedText.Value
        }
    )

 

 

But this is not working for the collection:

 

Patch(
        recordsList,
        {ID:selectedCall.ID},
        {
            Status: "Failed",
            Reason: Dropdown1.SelectedText.Value
        }
    )

 

 

Should I change all formulas from Patch to UpdateIf? Is it safer?

Hi @Sababneh ,

There is a known bug in Patch for updating records writing to fields that are blank, not sure if it is fixed, but I use UpdateIf for all updating and Patch (or Collect where possible) for new records and have never had an issue (which is why I gave you the option).

 

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,291)