Hi all,
Getting an error here that i am not understanding - expected boolean.
where am I going wrong here?
My fault - the example I provided was confusing. The syntax of the Choices function requires the name of your data source, together with the field:
Choices([@'Your List Name'].'Description Approval')
Full syntax:
UpdateIf(
colData,
true,
{
Status: "Submitted",
'Description Approval': LookUp(
Choices([@'Your List Name'].'Description Approval'),
Value = "Yes"
)
}
);
Note above there is no need to apply multiple conditions to your UpdateIf statement if the condition is always going to be true.
Hi @wonka1234,
Could you provide a bit more detail in what you're trying to do?
Are you trying to update all records in a collection or records that have the Status = Submitted?
@Amik grr still error -
@wonka1234 - The {Value: "string"} pattern is often misused and/or misunderstood. Forcing values into data types which require a record should be avoided.
You can pass a record into your UpdateIf statement using the LookUp function.
UpdateIf(
colData,
true,
{
Status: LookUp(
Choices([@'Status'].Choice),
Value = "Yes"
)
}
);
Further reading: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/working-with-tables
@Amik Update - I came up with these two solutions, however they arent actually patching in my SP list.
1. UpdateIf(colData, true, {Status: "Submitted"}, true, {'Description Approval': {Value: true}})
@wonka1234 - assuming your data source is SharePoint, and assuming the field you want to Patch is a Yes/No data type, enter "true" (without quotations) instead of "Yes".
WarrenBelz
146,537
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,908
Most Valuable Professional