I have a single page app for data entry which pulls values from two SQL server tables and then pushes data back to one of these tables.
I copied someone else's (working) app and changed the SQL server tables from theirs to mine.
However I'm getting errors all over the place and I can't figure out why.
I think most of the errors relate to the patch statement OnSelect of my Submit button, which should push all changes made to a record into a SQL server table.
My syntax for the Submit Button is :
If(
CountRows(CollectUpdate) > 0,
Patch(
'Powerapps.CRM_SCHEDULE_OF_SERVICES',
CollectUpdate
);
Notify(
"Success",
NotificationType.Success
)
);
Clear(CollectUpdate);The red zigzag lines start at the word 'Patch' and stop at the first semi colon.
The error message seems to be asking for a record, and not a table - but the existing app references a table and is fine.
It looks at five fields for changes and the field types are 3 x drop down, 1 x text input (number) and 1 x checkbox. Plus two meta data fields. The five input fields all have an identical formula for OnChange which is also broken at the point I mention 'Collect'.
Here is that code:
If(
ThisItem.ACCOUNT_ID in CollectUpdate.ACCOUNT_ID,
Update (
CollectUpdate,
LookUp(
CollectUpdate,
ACCOUNT_ID = ThisItem.ACCOUNT_ID
),
{
ACCOUNT_ID: ThisItem.ACCOUNT_ID,
SERVICE_WEIGHTING: Value(NEW_SERVICEWEIGHTING.Selected.Value),
FREQUENCY_AGREED: Value(NEW_FREQUENCYAGREED.Selected.Value),
VOLUME_AGREED: Value(NEW_VOLUMEAGREED.Text),
SCHEDULE_ACHIEVED: Value(NEW_SCHEDULEACHIEVED.Selected.Value),
USER: User().Email,
LOADDATE: Now()
}
),
Collect (
CollectUpdate,
{
ACCOUNT_ID: ThisItem.ACCOUNT_ID.Text,
SERVICE_WEIGHTING: Value(NEW_SERVICEWEIGHTING.Selected.Value),
FREQUENCY_AGREED: Value(NEW_FREQUENCYAGREED.Selected.Value),
VOLUME_AGREED: Value(NEW_VOLUMEAGREED.Text),
SCHEDULE_ACHIEVED: Value(NEW_SCHEDULEACHIEVED.Selected.Value),
YEAR: Value(SCHEDULE_YEAR.Selected.Value),
USER: User().Email,
LOADDATE: Now()
}
)
)
Can anyone help me fix this?

Report
All responses (
Answers (