
Hi all,
When pulling monthly data from dataverse I get the correct information using a simple filter:
ClearCollect(
RevenueItems,
Filter(
SelectedJob.Revenues,
ac_year = Value(DateSelector.SelectedText.Value)
)
);
The data in RevenueItems looks like this:
I then try to loop through the results to add any missing months, each new month being a new item in the collection:
ForAll(Filter(Loop,i<=4),
// if month number doesn't already exist in the revenue collection
If(CountIf(RevenueItems, ac_month = i + 1) = 0,
// add a new revenue month to the collection
Collect(RevenueItems, {ac_month: i + 1, ac_grossrevenue: 0, ac_netrevenue: 0, chance: 0})
)
);
Unfortunately, although the new items are added the original data seems to be lost:
I've tried many things to make this as simple as possible, but the problem always arises when I try to manipulate the collection after I've gathered the data.
Does anyone know what's going on?
I've resolved this issue, thanks to a post on powercommunity.com - https://www.powercommunity.com/data-in-collections-not-appearing-in-power-apps/.
The upcoming feature Explicit column selection prevents unused data being loaded, which I assume is a condition I met by trying to put the data into a collection. Unfortunately the use of the ShowColumns function as mentioned in the above post didn't work, so I disabled the feature: