anyone has faced this issue?
I use the Patch function to create the list in SharePoint list, but faced this error. When I pressed the button, it didn't load anything and no error. I need to check on appchecker.
Can you share your currant formula so we can see the problem in text format please ?
This one
//patch the current leave day with the updated balance
Patch(leaveTable,LookUp(leaveTable,Leave=Gallery_LeaveType.Selected.Title),{Days:LookUp(leaveTable,Leave = Gallery_LeaveType.Selected.Title,Days) - Totalleave });
//patch sp list of the user latest balance
Patch(CurrentUserBalance,LookUp(CurrentUserBalance,EmployeeName.Email = User().Email),{CurrentBalance:Concat(leaveTable,Days,";")});
//patch record to the draft form
Patch(LeaveRequest,Defaults(LeaveRequest),
{Title: TitleInput.Text},
{Startdate: StartDate.SelectedDate},
{StartdateType: Dropdown_StartDate},
{Enddate:EndDate.SelectedDate},
{EnddateType:Dropdown_EndDate},
{LeaveType:Gallery_LeaveType.Selected.Title},
{Totaldays:Totalleave});
Hi @mmchx
#1. I assume the Current balance is a numeric field but I see a string with concat
//patch sp list of the user latest balance
Patch(CurrentUserBalance,LookUp(CurrentUserBalance,EmployeeName.Email = User().Email),{CurrentBalance:Concat(leaveTable,Days,";")});
It should be
//patch sp list of the user latest balance
Patch(CurrentUserBalance,LookUp(CurrentUserBalance,EmployeeName.Email = User().Email),{CurrentBalance:Number});
#2. Patch function for Draft from
//patch record to the draft form
Patch(LeaveRequest,
Defaults(LeaveRequest),
{
Title: TitleInput.Text,
Startdate: StartDate.SelectedDate,
StartdateType: Dropdown_StartDate,
Enddate:EndDate.SelectedDate,
EnddateType:Dropdown_EndDate,
LeaveType:Gallery_LeaveType.Selected.Title,
Totaldays:Totalleave
}
);
Thanks,
Stalin - Learn To Illuminate
about the concat my currentbalance is a string.
something like this 10;8;15;3 to collect the current balance of each type.
The runtime error still occurs on the patch draft form
Hi @mmchx
I believe the error in LeaveType. If the leave type is Choice then try this
//patch record to the draft form
Patch(LeaveRequest,
Defaults(LeaveRequest),
{
Title: TitleInput.Text,
Startdate: StartDate.SelectedDate,
StartdateType: Dropdown_StartDate,
Enddate:EndDate.SelectedDate,
EnddateType:Dropdown_EndDate,
LeaveType: {Value: Gallery_LeaveType.Selected.Title},
Totaldays:Totalleave
}
);
If the problem continues then please let me know the Datatype for those fields to help further
Title: SingleLne Text,
Startdate: Date,
StartdateType: ?,
Enddate:Date,
EnddateType:?,
LeaveType:?,
Totaldays: Number
Thanks,
Stalin - Learn To Illuminate
It stills has a problem.
These are datatype of each field in my SharePoint list
Title: SingLine Text,
Startdate: Date,
StartdateType: SingLine Text,
Enddate:Date,
EnddateType:SingLine Text,
LeaveType:SingLine Text,
Totaldays: Number
Hi @mmchx
StartDateType and EndDateType are single-line text. And data comes from Dropdown. So this depends on the items property of the dropdown.
Please try this.
Patch(LeaveRequest,
Defaults(LeaveRequest),
{
Title: TitleInput.Text,
Startdate: StartDate.SelectedDate,
StartdateType: Dropdown_StartDate.Selected.Value,
Enddate:EndDate.SelectedDate,
EnddateType:Dropdown_EndDate.Selected.Value,
LeaveType: Gallery_LeaveType.Selected.Title
Totaldays:Totalleave
}
);
It could be
Dropdown_StartDate.Selected.Value
or
Dropdown_StartDate.Selected.Result
Hi @mmchx
Please let us know if anything needs on your post. We can help with this.
Please mark the post as Solved If I have answered your question.
Please give it a Thumbs Up if you find the suggestion helpful
Thanks,
Stalin - Learn To Illuminate
User | Count |
---|---|
254 | |
109 | |
92 | |
48 | |
37 |