I'm building a PowerApp, and part of it requires a Leave Enrollment record to be made and associated to a Worker record. Unfortunately, I'm having trouble creating it.
Using SubmitForm('FormName') doesn't actually create a record or return any errors, it just fires OnSuccess and does nothing.
I tried using the Patch function instead, but ran into a strange issue - it told me the issue was the fact that the 'Accrual Frequency' field isn't part of the record I'm creating (even though according to documentation, there is no 'Accrual Frequency' field in the Leave Enrollment entity). I created a custom Option Set and field to compensate, but then when I attempted to include it in the Patch function it informed me that the column does not exist.
Not sure where to go from here, so I'm looking for any suggestions. Is this an issue with the environment?
Thanks in advance!
Hi @CiaraL ,
To better understand your issue:
1. Do you mean the type of 'Accrual Frequency' field is Option set?
2. It seems that you use combo box(or dropdown) to select 'Accrual Frequency' , right? Can you share the items property of it?
3. Are all these errors related to Accrual Frequency' field?
I have made a test on my side, please refer to my example:
If you use a combo box to select 'Accrual Frequency', the items property of combo box should be:
Choices('Leave Enrollment'. 'Accrual Frequency' )
And modify that part of formula as below
Please have a try and check if your issue is fixed.
If this post helps, then please click on “Accept as Solution” to help the other members find it more quickly.
1. Yes, the type of the 'Accrual Frequency' field is an Option Set.
2. Yes, I created an Option Set and accompanying field (called 'Custom Accrual Frequency'), here is an image of the items property:
3. I believe there was an issue with the way I was setting up the Leave Plan field value I was submitting. I changed the formula to 'Accrual Frequency': customAccrualFrequencyValue.Selected.Value, and the remaining errors are that the Accrual Frequency column doesn't exist and that the function 'Patch' has some invalid arguments.
When I remove the Accrual Frequency part from the Patch function, the errors disappear, but unfortunately the record still isn't being made when I test the app.
There could be an issue with the 'Leave Plan' part of the formula, as I'm using a LookUp function to try and return a Leave Plan ID.
> 'Leave Plan': LookUp('Leave Plans', Name in leavePlanValue.Selected.Name)
Thank you for your response!
Hi @CiaraL ,
It is really weird that the system always can't find the column. Have you ever changed name 'Accrual Frequency' field? Can you go to check the Name of field in Entity -Field, and use Name instead of display name in formula?
To your 'Leave Plan' part of formula, if possible, i think you can also delete the that part to check if the lookup makes error . If it is true that there is something wrong with the lookup function, please share more details, e.g. field type, related controls.
I did a bit more digging into the problem last Friday, and found that after some changes to the formula I was able to actually make records. I found them using PowerBI, and they seem to be the same record (same Leave Enrollment Number). I've inserted an image of what I patch as part of creating the Leave Enrollment record, and the resulting records in PowerBI.
I use this formula to find the last Leave Enrollment Number and increment the number part by 1, could this be the issue?
Concatenate("LEAVEENROLL000",(Text(Value(Substitute(Last('Leave Enrollments').LeaveEnrollmentNumber, "LEAVEENROLL",""))+1)))
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
Check out the winners of the recent 'Can You Solve These?' community challenge!
Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.
Featuring samples like Return to the Workplace and Emergency Response Applications
Features releasing from October 2020 through March 2021