Hello,
I am trying to patch a single line text column and a choice column to update in the SharePoint list using power apps. The column names are 'Volunteer' and 'Gift"(Choice column). I want to update these columns whenever a 'Volunteer'(user) after logging into the app assigns a gift that is 'Ham' or 'Turkey'(Gift) to a particular person using a badge number in the SharePoint through a submit button. Here is the current code for the Onselect property of the submit button.
Set(
varCardNumber,
LookUp(
'Associate Record',
cardNumber = badge_number.Text,
true
)
);
Set(
varGift,
LookUp(
'Associate Record',
cardNumber = badge_number.Text,
Gift
)
);
Set(
GiftName,
If(
Turkey_Toggle.Value = true,
"Turkey",
"Ham"
)
);
If(
varGift.Value = GiftName,
Notify(
"Gift Already Issued",
NotificationType.Error
),
If(
varCardNumber = true,
Set(
varShowPopUp,
true
),
Set(
varShowPopUpNotMatched,
true
)
);
Patch(
'Associate Record',
LookUp(
'Associate Record',
cardNumber = badge_number.Text
),
{
Gift: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 1,
Value: If(
Turkey_Toggle.Value = true,
"Turkey",
"Ham"
)
}
}
);
Notify(
"Patched",
NotificationType.Success
);
Refresh('Associate Record');
);

Report
All responses (
Answers (