Hi all,
I seem to have found Schroedingers Collection.
I have to programmatically add a column to a collection in an onSelect Action of a button. The collection then gets patched back to a SQL Server Table.
When adding the Column with:
AddColumns(
colLocalReasonsSingleShift;
"EntryID";
LookUp(
colSolution As table;
table.RowNumber = Value(BelongsTo)
).ID
);;
There is an Error telling me that EntryID already exists (I would show you a screenshot, but my powerapps is german, thats also why there are semicolons instead of commas).
When I do this however:
AddColumns(
DropColumns(
colLocalReasonsSingleShift;
"EntryID");
"EntryID";
LookUp(
colSolution As table;
table.RowNumber = Value(BelongsTo)
).ID
);;
It first tells me that the column doesn't exist and then tells me that the column already exists in the outer addColumn function.
When I use a different column name it works flawlessly with the first variant. Unfortunately, the patch wouldn't work likethat.
I checked the other instances where the collection is created or modified. Before the collection comes into existence the Column "EntryID" from the original datasource is dropped. There is no mending with "EntryID" anywhere else.
I guess this is either a really weird case of caching/ state mix-up or the error message is wrong.
Any ideas on what I can do here?
I appreciate any help!
Regards
Eric