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
Dual Super User

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
Dual Super User

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,611)