I'm creating an App and I want a record to be inserted into SQL table once I click Submit.
So, in the submit button, Onselect I wrote a patch as below,
Patch(
UserChangeLog;
Defaults(UserChangeLog),
{
M3_User: UserID.Text,
M3_ChangeDate: DatePickerFrom.SelectedDate,
M3_MasterFacility:FacilityLabel.Text,
ActualRevertTime:DatePickerFrom.SelectedDate,
M3_ChangeFacility:FacilityDropdown.Selected.CFFACI,
Processed:UserID.Text,
ScheduleRevertTime:DateAdd(DatePickerFrom.SelectedDate,1,TimeUnit.Days) + Time(0,0,0,0)
}
)
Patch seems to be correct as Power App did not show any error. I revised a few time to get this.
Now, my SQL table name is dbo.UserChangeLog.
COLUMN_NAME DATA_TYPE
M3_User nchar
M3_MasterFacility nchar
M3_ChangeFacility nchar
M3_ChangeDate datetime
Processed char
ScheduleRevertTime datetime
ActualRevertTime datetime
When I run my app in development mode, record is not getting inserted to the table.
I checked the permissions in SQL, I'm the DB owner. Don't know what else should I check. Please guide.
Thanks,
Vishwa