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

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.
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.
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

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,120)