Hi. I am new to Powerapps
I have developed a small app which updates a sql table via an on premise gateway. Right now it is connected to a dummy table containing a small amount of data.
I want to be able to declare the table/connection in a variable onStart so in future I would not have to go through each function to edit the DataSource.
Original code:
If(
CountRows(colTaskUpdates) > 0,
Patch(DataTable,colTaskUpdates);
);
Clear(colTaskUpdates);
Refresh(DataTable)
I changed it to this thinking there would be no issues
Set(myConnection,DataTable);
If(
CountRows(colTaskUpdates) > 0,
Patch(myConnection,colTaskUpdates);
);
Clear(colTaskUpdates);
Refresh(myConnection)
In the Patch function with my code I get this message: "The first argument of 'Patch' should be a collection".
although the refresh function works with the variable.
Reading through the documentation I still could not find the answer to why the variable can not be passed.
Thank you in advance