
Hi,
I need to merge 2 collections with similar data into new Collection so that I can compare in Gallery line by line and mark the differences in colors if no match between the 2 collection data.
So from my colMasterData system needs to fetch data from importedData with similar 4 column values and Collect myData record.
If no mapping is found then it should look for 3 similar column values, then 2 columns and so on. If no match then it should collect empty values for the imported data which is not a problem.
I tried to use ForAll condition function With, but no success and now using 2 ForAll's for each collection with conditions to collect but not getting the expected result, also not clean code.
//ClearCollect(Mergetable,"")
ClearCollect(
varExempleREDS2,
varExempleREDS
);
ClearCollect(
varExempleHFImport2,
varExempleHFImport
);
Clear(Mergetable);
ForAll(
varExempleREDS,
ForAll(
varExempleHFImport,
If(
varExempleREDS[@CellName] = varExempleHFImport[@CellName] && varExempleREDS[@Antenna] = varExempleHFImport[@Antenna],
Collect(
Mergetable,
{
AllParam: true,
CellREDs: varExempleREDS[@CellName],
CellHF: varExempleHFImport[@CellName],
AntennaHF: varExempleHFImport[@Antenna],
AntennaREDs: varExempleREDS[@Antenna]
}
);
RemoveIf(
varExempleREDS2,
CellName = varExempleREDS[@CellName] && Antenna = varExempleREDS[@Antenna]
);
RemoveIf(
varExempleHFImport2,
CellName = varExempleHFImport[@CellName] && Antenna = varExempleHFImport[@Antenna]
)
)
)
)This is just an example in the end I will have to collect with 4 conditions and then 3.... So the code will be not clean.
So then I do the same again but with different condition and again new collections without the records of older collections.
ForAll(
varExempleREDS2,
ForAll(
varExempleHFImport2,
If(
varExempleREDS2[@CellName] = varExempleHFImport2[@CellName] &&
(varExempleREDS2[@Antenna] <> varExempleHFImport2[@Antenna]),
Collect(
Mergetable2,Thanks in advance It should help many PowerApps dev if there is a way to loop through 2 collections and collect.