cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AD1990
Helper II
Helper II

Standalone patch function works on a button but gives error when put in conjunction with other functions

So, I have a form where the students can apply for classes under a specific teacher.

This screen has a text box with a text box where the student can type anything and then ticks the 'i agree to the terms and conditions' checkbox and then clicks on the submit button.

The submit button will check that the checkbox is ticked, update a sharepoint list with the required data, trigger email to the teacher keeping the student in cc and then the button itself will disappear.

OnSelect property of the button has this code:

 

If(Checkbox1.Value = true,
Office365Outlook.SendEmail(
"xxxxxxx@xxxxxx.com",
"Applying for tuition",
"You have a pending access request.
Requested by: " & currentUser.FullName
& "
Requesting tuition under you for subject"
& Upper(varComp)
,{Cc:currentUser.Email,Importance:"High"}
)

&&
Notify(
"The teacher has been notified that you have applied for tuition. Kindly wait for a response from them.",
NotificationType.Information
)

&&

Set(varVisible1, "666")
&&<--------code given below in italics goes here------->

,
Notify("Please accept the terms and conditions before clicking on submit",NotificationType.Error)
)

The above code works perfectly.

But when I append the below code, the patch functions throws an error.

 

Patch
(
'Teaching',
Defaults('Teaching'),
{
Tuition_Status: {Value: "Applied"}
}
)

 

The patch functions works perfectly fine as a standalone function.

 

Any suggestions?

 

PS: The variables set here are for disabling the button. Ignore that part

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @AD1990 

 

Just noticed and we can change the order a bit.

 

If(Checkbox1.Value,
Patch Function;
Send Email;
Notify function;
Set Variable;
,
Notify("Please accept the terms and conditions before clicking on submit",NotificationType.Error)
)

 

Please let me know if any help with this.


Thanks,
Stalin - Learn To Illuminate

View solution in original post

3 REPLIES 3
StalinPonnusamy
Super User
Super User

HI @AD1990 

 

Here are the Overall Steps;

If(Checkbox1.Value,

Send Email;
Notify;
Set Variable;
Patch Function
,
Notify("Please accept the terms and conditions before clicking on submit",NotificationType.Error)
)

 


Thanks,
Stalin - Learn To Illuminate

StalinPonnusamy
Super User
Super User

Hi @AD1990 

 

Just noticed and we can change the order a bit.

 

If(Checkbox1.Value,
Patch Function;
Send Email;
Notify function;
Set Variable;
,
Notify("Please accept the terms and conditions before clicking on submit",NotificationType.Error)
)

 

Please let me know if any help with this.


Thanks,
Stalin - Learn To Illuminate

Thanks. This was the perfect solution.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,175)