I am working with a collection connected to a gallery. Initially, I load data from a Dataverse table (GrpAAA_EntityData) into the collection (ColNodes):
ClearCollect (ColNodes, ShowColumns ( GrpAAA_EntityData, _JAHP_Name, _JAHP_EntityId, _JAHP_InstanceId, _JAHP_EntityInstanceKey ));
Later I want to reload to the same collection (ColNodes), but this time with data coming from another collection (ColTemp) that is created like this:
ClearCollect (ColTemp, ShowColumns(ColParentNodes, _JAHP_Name, _JAHP_LnkParentNodeEntity, _JAHP_LnkParentNodeInstance, _JAHP_LnkParentNodeKey));
As you can see, both data sources are similar and compatible in terms of number of columns, but the column names are different.
Therefore as part of the new data load, I try to change the column names of the ColTemp collection before I load the data:
ClearCollect(ColNodes,
RenameColumns(ColTemp,
_JAHP_Name, _JAHP_Name,
cr406__jahp_lnkparentnodeentity, _JAHP_EntityId,
cr406__jahp_lnkparentnodeinstance, _JAHP_InstanceId,
cr406__jahp_lnkparentnodekey, _JAHP_EntityInstanceKey
)
);
What I end up with is a ColNodes collection with 8 columns and only with data in the first 4 columns originating from the 'RenameColumns' function...
The outcome of all of this is also, that the display of the new data in the connected gallery goes wrong, because the labels in the gallery are connected to the columns without data...
So I see two challenges here...: In order for me to rename the column names of the ColTemp collection, I had to use the full display name with the prefix coming from the environment, and still the outcome is that the resulting collection is incompatible with the column names of the ColNodes collection so data is collected in 4 new columns adding to a new version of the ColNodes collection, now with 8 columns.
Can someone explain what is happening here, and what can I do to solve this challenge ?
Thanks in advance.