cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DDucolonSBUX
Advocate I
Advocate I

Updating SharePoint with a Blank Person record does not update the SharePoint list

Hello,

 

I have an issue that seems like it should be rather common to fix.  I am using SharePoint as my data source.  The scenario is, basically when a person no longer has an assignment, they need to be removed and that should update in SharePoint.

 

My issue is that the user can be blanked out in the default combo box control in PowerApps but when the record updates the change to a null value does not propagate back to SharePoint.

 

To get around this issue I have tried many things and I will describe the one that seems like it should by all means work.

1. I have created a Blank Person record variable in my PowerApp at the initial app level

Set(BlankPerson,{   Claims:Blank(),
                    DisplayName:Blank(),
                    Email:Blank(),
                    Department:Blank(),
                    Picture:Blank(),
                    JobTitle:Blank()});

2. I then check for a change to blank in the default combo box control in the On Change property.

If(IsBlank(ProjectManagerDataCardValue.Selected.DisplayName),
     UpdateIf(MyList, ID = varRecord.ID,
     {'Project Manager': BlankPerson}
);

 

I run the code and X out the assigned Project Manager.  The code runs successfully, which I know because I set a variable in the next line of code in the block and I display that value which does change.  So I know it runs well.  There are no errors registered.

 

I refresh my page and the old Project Manager value is still showing.  When I check SharePoint, no change has been applied.

 

Am I approaching this incorrectly?  Or is this a known bug?  Or does anyone know how to make this change reflect in SharePoint after being removed in PowerApps?

1 ACCEPTED SOLUTION

Accepted Solutions

@DDucolonSBUX 

Make sure you have Formula Level Error Management on in your advanced settings - otherwise you will not be able to change to a blank person.

_____________________________________________________________________________________
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

4 REPLIES 4
mdevaney
Super User
Super User

@DDucolonSBUX 

Can you please try to replace this code...

{'Project Manager': BlankPerson}

 

...with this code?  Blank() is typically how you would PATCH an empty value.

{'Project Manager': Blank()}

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I have tried that before and I just replaced my blank record with the Blank() function again and tried it. And still no change in SharePoint.  I am trying to execute this with the On Change event.

If(IsBlank(ProjectManagerHeaderDataCardValue.Selected.DisplayName),
     UpdateIf('Proposal Intake', ID = varRecord.ID,
	{'Project Manager': Blank()}
);

FYI, I have also tried to use the Patch command and as you see the UpdateIf command and neither seem to be able to update SharePoint.  Since Project Manager is a complex data type (Person or Group set to a single value) I also tied setting this via Patch with a complex field update.

Patch(
	'MyList',
	varRecord,
	{'Project Manager': {
	'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
		Claims:Blank(),
		DisplayName:Blank(),
		Email:Blank(),
		Department:Blank(),
		Picture:Blank(),
		JobTitle:Blank()
		}
	}
)

 So any idea on how to update Sharepoint Person field from PowerApps with a blank or null value?

@DDucolonSBUX 

Make sure you have Formula Level Error Management on in your advanced settings - otherwise you will not be able to change to a blank person.

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

Thanks so much!  This has really fixed my issue and gotten me unblocked.  You Rock!!!

Helpful resources

Announcements
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 (4,902)