Hi @freedumz,
Could you please share a bit more about your table?
I have made a test on my side, please take a try with the following wortkaround:
Set the OnVisbile property of the first screen to following formula:
ClearCollect(
BaseTable,
{Country:"USA",Name:"Max"},
{Country:"USA",Name:"Max"},
{Country:"USA",Name:"Bob"},
{Country:"Canada",Name:"Luc"},
{Country:"Canada",Name:"Max"},
{Country:"Canada",Name:"Bob"},
{Country:"Canada",Name:"Bob"}
)
Note: The BaseTable represents the source table that you mentioned. On your side, you could use ShowColumns function to get the columns that you want to get (strips out all the unneeded columns).
Set the OnSelect property of the "Modify" button (Button control) to following formula:
ClearCollect(Collection1,RemoveIf(RenameColumns(RenameColumns(BaseTable,"Country","Country1"),"Name","Name1"),CountRows(Filter(BaseTable,Name=Name1&&Country=Country1))>1));
ForAll(
RenameColumns(RenameColumns(BaseTable,"Country","Country1"),"Name","Name1"),
If(
CountRows(Filter(BaseTable,Country=Country1&&Name=Name1))>1&&IsEmpty(Filter(Collection2,Name=Name1&&Country=Country1)),
Collect(Collection2,LookUp(BaseTable,Country=Country1&&Name=Name1))
)
);
ForAll(RenameColumns(RenameColumns(Collection2,"Name","Name2"),"Country","Country2"),Patch(Collection1,Defaults(Collection1),{Name1:Name2,Country1:Country2}))
Set the Items property of the Data table control to following formula:
RenameColumns(RenameColumns(Collection1,"Name1","Name"),"Country1","Country")
Note: The Collection1 represents the data table that you want to get.
Best regards,
Kris