I am building a risk assessment app, that should bulk update predefined fields if multiple items are selected (with checkmarks). Fields circled with red can be updated in bulk for all selected items. However, based on my current logic, if I leave some of these fields empty, then the values are still updated in collection for selected items with NULLs.
My current logic for UPDATE button is this:
UpdateIf(
colGridData,
ThisRecord in colSelected,
{
Other: BulkOther.Selected,
Capacity: BulkCapacity.Selected,
'Mitigation Priority': BulkMitigationPriority.Selected.Value,
'Mitigation Strategy Date': BulkMitigationStrategyDate.SelectedDate,
'Strategic Criticality': BulkStrategicCriticality.Selected
}
);
I would like to find a way to ONLY update fields where I select some value and ignore empty ones. I have tried to incorporate this in the following way, but in the end this broke the logic as UPDATE button does not update anything anymore.
UpdateIf(
colGridData,
ThisRecord in colSelected && (IsEmpty(BulkOther.Selected) || IsBlank(BulkOther.Selected)) && (IsEmpty(BulkCapacity.Selected) || IsBlank(BulkCapacity.Selected)) && (IsEmpty(BulkMitigationPriority.Selected.Value) || IsBlank(BulkMitigationPriority.Selected.Value)) && (IsEmpty(BulkMitigationStrategyDate.SelectedDate) || IsBlank(BulkMitigationStrategyDate.SelectedDate)) && (IsEmpty(BulkStrategicCriticality.Selected) || IsBlank(BulkStrategicCriticality.Selected)),
{
Other: BulkOther.Selected,
Capacity: BulkCapacity.Selected,
'Mitigation Priority': BulkMitigationPriority.Selected.Value,
'Mitigation Strategy Date': BulkMitigationStrategyDate.SelectedDate,
'Strategic Criticality': BulkStrategicCriticality.Selected
}
);
Any tips on how to avoid overwriting the data if no value is chosen for one of the bulk update fields? I think it would also be a cool use case if the logic could incorporate updating fields to NULL, if say NULL is written or chosen in a dropdown for some bulk update fields, but if nothing is chosen then UPDATE button would not overwrite data with NULL values.

Report
All responses (
Answers (