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

Saving a missing value for complex data using patch

I have a canvas app for data stored in a SharePoint list. The problem am facing is when I try to delete a complex value (person or managed metadata) in my combo box and then try to patch it – it doesn’t work. This is not an issue for new records, just on edit of an existing record with a value already set. 

 

I have already tried the following –

  1. Setting the record values explicitly to blank() (eg. Claims: Blank() ) on a variable and then using that in my patch
  2. Enabling experimental setting for Formula Error Level Management

Any guidance on how to reset a complex variable?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@PowerNewUser 

You don't need any of this for what you want.

If MFGDirector is set to the formula with the choices function as you show, then you simply need to use the selected record as the PartnershipDirector value.

i.e.

   UpdateIf(yourData, criteriaForRecord, {PartnershipDirector: MFGDirector.Selected})

_____________________________________________________________________________________
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!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@PowerNewUser 

Can you provide the Formula you are trying to use?

In general, if you are using Patch (UpdateIf preferred), then you can set that column to Blank() as long as you have Formula-Level error management turned on.

_____________________________________________________________________________________
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!

This was my first attempt - it sets blank if i don't select a combo value. Problem is if I change an existing value to blank. 
PartnershipDirector: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: MFGDirector.Selected.Claims,
Department: MFGDirector.Selected.Department,
DisplayName: MFGDirector.Selected.DisplayName,
Email: MFGDirector.Selected.Email,
JobTitle: MFGDirector.Selected.JobTitle,
Picture: MFGDirector.Selected.Picture
}
where MFGDirector is a combo tagged to my person field in the gallery (Choices([@FSPList].PartnershipDirector)). 

I then also tried setting a variable with Blank() for all values if the selected.displayname was "" and combo values otherwise. I then passed the variable in the patch instead of the combo reference above. 

RandyHayes
Super User
Super User

@PowerNewUser 

You don't need any of this for what you want.

If MFGDirector is set to the formula with the choices function as you show, then you simply need to use the selected record as the PartnershipDirector value.

i.e.

   UpdateIf(yourData, criteriaForRecord, {PartnershipDirector: MFGDirector.Selected})

_____________________________________________________________________________________
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!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,777)