I'm using a patch function on a PowerApps form to update specific (Dropdown_ProjectName.Selected
) project records in an underlying list.
The patch works great for the 'Budget percentage' field (TextInput
), but I'm having trouble patching two multi-select Choice
columns: 'Team composition', which is a Person field (containing DisplayName, ...), and 'Countries'.
When I use .SelectedItems
as for the Team composition
column, the form saves only 1 item, and not any others that have been selected.
The ForAll()
formula I use for the Countries
column - which appears to be a solution proposed elsewhere on this forum - produces multiple errors for me, so I might be using it wrong.
How an I fix this?
Patch('Project database', Dropdown_ProjectName.Selected, {
'Team composition': DataCardValue_TeamMembers.SelectedItems,
'Countries': ForAll(DataCardValue_Countries.SelectedItems As aCountry, {Value: aCountry.Value}),
'Budget percentage': Value(DataCardValue_BudgetPercentage.Text)/100
});
DefaultSelectedItems
property of the Countries
multi-select field is populated with existing items from the selected project, like so:Team members
it's like this:Update
property of the DataCard_Countries
is set to DataCardValue_Countries.SelectedItems, the Update
property of the DataCard_TeamMembers is set to DataCardValue_TeamMembers.SelectedItemsTeam composition
': ForAll(DataCardValue_TeamMembers.SelectedItems, {Budget percentage
': Value(DataCardValue_BudgetPercentage.Text)/100DefaultSelectedItems
properties of the 'Countries' and 'Team composition' fields which were defined as:Dropdown_ProjectName.Selected
, because the correct row is being updated (a) every time I patch the TextInput field ('Budget percentage'), and (b) whenever the 'Team_composition' and 'Countries' fields are still empty in the underlying list and I patch them for the first time. Patch( Customers, Defaults( Customers ), { CustomerName: "Contoso" } )
Updating an existing Item
Patch( Customers, Filter( Customers, CustomerName = "Contoso" ), { Phone: "1-212-555-1234" } )
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,948
Most Valuable Professional