
Announcements
I have adjusted DisplayMode of some of my fields in the editable grid to view only if risk factor is 'Unlikely'. However, when I do bulk update of data, DisplayMode is completely bypassed as fields get updated with chosen information as long as they are selected (have a checkmark to their record -> i.e. are saved in colSelected selection). I would like to still bulk update information to selected items, but if an item have DisplayMode = View, then it should not be possible to bulk update this specific field (I cannot update this if I do 1 value updates directly in the grid, as it is displayed in View mode).
DisplayMode for the fields:
If(IsBlank(RiskLikelihood) || IsEmpty(RiskLikelihood) || RiskLikelihood.Text = "Unlikely",DisplayMode.View,Parent.DisplayMode)Screenshot of the app:
Red circle indicates items in colSelected, which is used for bulk updating
Black circle indicates all the bulk update possibilities for items in colSelected
Red circle indicates an item that has 'Unlikely' Risk Likelihood, therefore, it is in View mode, however, I can still bulk update it if it is in colSelected.
OnSelect property for UPDATE SLECTED ITEMSbutton (that is where I would assume additional logic, that checks if an item is in View mode or not, should be placed):
UpdateIf(
colGridData,
ThisRecord in colSelected,
{
Capacity: If(!IsBlank(BulkCapacity.Selected), BulkCapacity.Selected, Capacity),
Other: If(!IsBlank(BulkOther.Selected), BulkOther.Selected, Other),
'Lost Sales Impact': If(!IsBlank(BulkLostSalesImpact.Selected), BulkLostSalesImpact.Selected.Value, 'Lost Sales Impact'),
'Growth Rate': If(!IsBlank(BulkGrowthRate.Selected), BulkGrowthRate.Selected.Value, 'Growth Rate'),
'NN Customized vs Generic': If(!IsBlank(BulkNNCustomizedVsGeneric.Selected), BulkNNCustomizedVsGeneric.Selected.Value, 'NN Customized vs Generic'),
'NN Market Proportion': If(!IsBlank(BulkNNMarketProportion.Selected), BulkNNMarketProportion.Selected.Value, 'NN Market Proportion'),
'Strategic Priority': If(!IsBlank(BulkStrategicPriority.Selected), BulkStrategicPriority.Selected.Value, 'Strategic Priority'),
'Mitigation Strategy Date': If(!IsBlank(BulkMitigationStrategyDate.SelectedDate), BulkMitigationStrategyDate.SelectedDate, 'Mitigation Strategy Date'),
'Mitigation Strategy': If(!IsBlank(BulkMitigationStrategy.Selected), BulkMitigationStrategy.Selected.Value, 'Mitigation Strategy'),
'Mitigation Year': If(!IsBlank(BulkMitigationYear.Selected), BulkMitigationYear.Selected.Value, 'Mitigation Year')
}
);
Clear(colSelected);
Reset(headerCheckboxAll);
Reset(BulkCapacity);
Reset(BulkOther);
Reset(BulkLostSalesImpact);
Reset(BulkGrowthRate);
Reset(BulkNNCustomizedVsGeneric);
Reset(BulkNNMarketProportion);
Reset(BulkStrategicPriority);
Reset(BulkMitigationStrategyDate);
Reset(BulkMitigationStrategy);
Reset(BulkMitigationYear);
Does any of you have some great ideas how to avoid bulk updating fields with DisplayMode = View?
HI @bmtb ,
Try something like this - also avoids the first collection (assuming you have the record ID in your collection and gallery)
ForAll(
Filter(
GalleryName.AllItems,
CheckBoxName.Value
) As aPatch,
If(
Len(aPatch.RiskLikelihood) > 0 && aPatch.RiskLikelihood <> "Unlikely",
Patch(
colGridData,
LookUp(
colGridData,
ID = aPatch.ID
),
{
Capacity: Coalesce(aPatch.BulkCapacity.Selected, Capacity),
Other: Coalesce(aPatch.BulkOther.Selected, Other),
'Lost Sales Impact': Coalesce(aPatch.BulkLostSalesImpact.Selected.Value, 'Lost Sales Impact'),
'Growth Rate': Coalesce(BulkGrowthRate.Selected.Value, 'Growth Rate'),
'NN Customized vs Generic': Coalesce(BulkNNCustomizedVsGeneric.Selected.Value, 'NN Customized vs Generic'),
'NN Market Proportion': Coalesce(BulkNNMarketProportion.Selected.Value, 'NN Market Proportion'),
'Strategic Priority': Coalesce(BulkStrategicPriority.Selected.Value, 'Strategic Priority'),
'Mitigation Strategy Date': Coalesce(BulkMitigationStrategyDate.SelectedDate, 'Mitigation Strategy Date'),
'Mitigation Strategy': Coalesce(BulkMitigationStrategy.Selected.Value, 'Mitigation Strategy'),
Mitigation Year': Coalesce(BulkMitigationYear.Selected.Value, 'Mitigation Year')
}
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps