When customising some functions or controls, we have found that sometimes you have a text version of a OptionSet value. If you want to patch this then Power Apps will error.
The following has helped.
If the custom control is called for example, ddCustomDropdown:
With(
{
locNameOfTheVarable LookUp(
Choices('Table'.'choiceName'),
Text(Value) = ddCustomDropdown.SelectedItem.Value
).Value
},
We stored the value as locNameOfTheVarable. We can now call that when we patch.
Patch(
'Table Name',
Defaults('Table Name'),
{
ChoiceToPatch: locNameOfTheVarable
}
)
Don't forget to put another ")" but you should be right to go.
Leave a Comment