My power app a person (or people picker) field. The Patch function (triggered via a button on an EditForm) does add a name to or change a name on the SharePoint list. However, when the field is cleared or changed to from someone to blank, currently my Patch function does not clear said field.
List name: Clearance Review Tracker2
People picker field: Contracting Officer
Part of Patch Function that either adds or updates the Contracting Officer field.
If(
IsBlank(
LookUp(
'Clearance Review Tracker2',
PR = DataCardValue9.Text
)
),
SubmitForm(EditForm1),
Patch(
'Clearance Review Tracker2',
LookUp(
'Clearance Review Tracker2',
PR = DataCardValue9.Text
),
{
PIID: DataCardValue10.Text,
'Contracting Officer': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(DataCardValue15.Selected.Email),
Department: DataCardValue15.Selected.Department,
DisplayName: DataCardValue15.Selected.DisplayName,
Email: DataCardValue15.Selected.Email,
JobTitle: "",
Picture: ""
},
Discovered that the following does clear / or sets Contracting Officer to blank
'Contracting Officer' : Blank()
Thinking I need an If STMT that includes an IsBlank check.
Something along the lines of:
If(IsBlank(DataCardValue15.??),
'Contracting Officer' : Blank(),
'Contracting Officer': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(DataCardValue15.Selected.Email),
Department: DataCardValue15.Selected.Department,
DisplayName: DataCardValue15.Selected.DisplayName,
Email: DataCardValue15.Selected.Email,
JobTitle: "",
Picture: ""
}),
If an IF STMT is the way to go, I not sure how to put it into the Patch function per the button on my EditForm?
– OR – there another way to update a person field from someone to blank?
Something along the lines of:
If(IsBlank(DataCardValue15.??),
'Contracting Officer' : Blank(),
'Contracting Officer': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(DataCardValue15.Selected.Email),
Department: DataCardValue15.Selected.Department,
DisplayName: DataCardValue15.Selected.DisplayName,
Email: DataCardValue15.Selected.Email,
JobTitle: "",
Picture: ""
}),
If an IF STMT is the way to go, I not sure how to put it into the Patch function per the button on my EditForm?
– OR – there another way to update a person field from someone to blank?