cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
urvashi19
Frequent Visitor

Patch function for updating sharepoint choice column

 I am not able to use this while updating my sharepoint choice column from powerapp: '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"

 

 

Patch('INVENTORY LIST',{trialstatus:{Value:"ok1",'@odata.type': "#Microsoft​.Azure.Connectors.SharePoint.SPListExpandedReference"}})Capt3ure.PNGCapture.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @urvashi19 ,

 

Check https://youtu.be/g9ChYuTdNd4

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

Hi@urvashi19,

Based on the issue that you mentioned, do you want to update the status within the Gallery selected record?

Could you please share a bit more about the scenario?

Have seen the error message you provided, I think you should refresh your data source before you trigger the Patch() formula.

Please modify you formula as below:

Select(Parent);
Refresh('Hotel Inventry'); // Add this Refresh before the Patch()
Patch(
    'Hotel Inventry',
    Gallery1.Selected,
    {Status: {Value: "Assigned"}}
)

Hope it could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

5 REPLIES 5
RezaDorrani
Dual Super User II
Dual Super User II

Hi @urvashi19 ,

 

Check https://youtu.be/g9ChYuTdNd4

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

RandyHayes
Super User
Super User

@urvashi19 

You're going to need to specify the Record that you want to patch in your Patch formula.

You no longer need to specify the odata.type in the formula, but you DO need to tell it what record to change in your data source.

Patch('INVENTORY LIST', whatRecord?, {trialstatus:{Value:"ok1"}})

 

Now, if you are just updating the status, then you might want to consider and UpdateIf instead:

UpdateIf('INVENTORY LIST', ID=someID, {trialstatus: {Value:"ok1"}})

 

But either way...you must supply what you want to patch/update.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Screenshot (289).png

 

 

Can you please help me with this one.

RandyHayes
Super User
Super User

@urvashi19 

UpdateIf('Hotel Inventory', ID=ThisItem.ID, {Status: {Value:"assigned"}})

 

Also do a refresh on your datasource in the designer at this point just to make sure your data has the proper etags.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi@urvashi19,

Based on the issue that you mentioned, do you want to update the status within the Gallery selected record?

Could you please share a bit more about the scenario?

Have seen the error message you provided, I think you should refresh your data source before you trigger the Patch() formula.

Please modify you formula as below:

Select(Parent);
Refresh('Hotel Inventry'); // Add this Refresh before the Patch()
Patch(
    'Hotel Inventry',
    Gallery1.Selected,
    {Status: {Value: "Assigned"}}
)

Hope it could help.

Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

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