Not really sure why I am getting this error. I have tried removing parenthesis. Also, tried adding another parenthesis with semi colon. Nothing seems to work. Any ideas? Thank you.
With({data: NewIncidentForm.LastSubmit},
// SEND NOTICE TO ALL SELECTED GROUPS
ForAll(emaillist,
Office365Outlook.SendEmailV2(
EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
);
// SEND NOTICE TO INTERNAL STAFF
Office365Outlook.SendEmailV2(
"xxxx@xxxx.com; xxxx@xxxx.com",
data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
);
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover)
Solved! Go to Solution.
Hello again @thunter
Funny...I still had this formula up on my screen from a month ago when we went through it.
I believe the correction below is what you want (and why you are not seeing the email to the exec - because the closing parens for the ForAll were put in the wrong place.
This should be the correct version.
With({data: NewIncidentForm.LastSubmit},
// SEND EMAIL TO SELECTED GROUPS
ForAll(emaillist,
Office365Outlook.SendEmailV2(EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "
<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
)
);
// SEND EMAL TO EXECUTIVES
Office365Outlook.SendEmailV2(
"xx@xx.com; xx@xx.com",data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
)
);
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover)
This will at least send to the execs and the user. The emaillist is the next thing to look at.
What I don't seem to have any more is where we were getting emaillist from? I thought that was a dropdown or combobox or something.
Please clarify again.
I think you just forgot to close your WITH statement, that's all. Here's my idea:
With({data: NewIncidentForm.LastSubmit},
// SEND NOTICE TO ALL SELECTED GROUPS
ForAll(emaillist,
Office365Outlook.SendEmailV2(
EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
);
// SEND NOTICE TO INTERNAL STAFF
Office365Outlook.SendEmailV2(
"xxxx@xxxx.com; xxxx@xxxx.com",
data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
);
) // I added this bracket
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Thanks for the quick reply! When I added your bracket, I still have the same error plus a new error. See below. Thank you.
Good lord, haha. I forgot the semi-colon.
ith({data: NewIncidentForm.LastSubmit},
// SEND NOTICE TO ALL SELECTED GROUPS
ForAll(emaillist,
Office365Outlook.SendEmailV2(
EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
);
// SEND NOTICE TO INTERNAL STAFF
Office365Outlook.SendEmailV2(
"xxxx@xxxx.com; xxxx@xxxx.com",
data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
)
); // I added this bracket and a colon
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover);
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Ha! That cleared up the first error, but I still have the original error. This is confusing me, as these formulas are usually pretty easy and work well, not sure what I did wrong.
@thunter
Maybe two brackets are needed because there is also a FORALL loop I missed earlier
With({data: NewIncidentForm.LastSubmit},
// SEND NOTICE TO ALL SELECTED GROUPS
ForAll(emaillist,
Office365Outlook.SendEmailV2(
EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
);
// SEND NOTICE TO INTERNAL STAFF
Office365Outlook.SendEmailV2(
"xxxx@xxxx.com; xxxx@xxxx.com",
data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
)
)); // I added two brackets and a colon
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover);
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi,
You're missing two ")" to close the ForAll and With functions.
Clรฉment
Yep, agreed. I finally came to that conclusion above after I placed it in the code editor. Thanks for confirming ๐
That extra bracket took care of all the errors. However, it is not emailing now. It seems that it is not collecting the email address for the emaillist, which I use in the formula to email multiple emails. Although not entirely sure because it doesn't email to the executives either which is the 2nd email formula.
With({data: NewIncidentForm.LastSubmit},
// SEND EMAIL TO SELECTED GROUPS
ForAll(emaillist,Office365Outlook.SendEmailV2(EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
);
// SEND EMAL TO EXECUTIVES
Office365Outlook.SendEmailV2("xx@xx.com; xx@xx.com",data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
);
)); // I added this bracket
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover)
Correct me if i'm wrong, but i feel like your ForAll loop is only the emailing to groups ?
If so the closing of that function is not at the correct place and should look like :
With({data: NewIncidentForm.LastSubmit},
// SEND EMAIL TO SELECTED GROUPS
ForAll(emaillist,Office365Outlook.SendEmailV2(EmailAddr,
Coalesce(data.billto, data.name) & "- New Incident - " & data.incident_num,
"<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ") & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status
);
);
// SEND EMAL TO EXECUTIVES
Office365Outlook.SendEmailV2("xx@xx.com; xx@xx.com",data.name & "- New Incident - " & data.incident_num,
"<b>Incident Date: </b>" & data.inc_date & "<br>
<b>Incident Number: </b>" & data.incident_num & "<br>
<b>Name: </b>" & data.name & "<br>
<b>Date Reported: </b>" & Today() & "<br>
<b>Trip #: </b>" & data.trip & "<br>
<b>Tractor: </b>" & data.tractor & "<br>
<b>Trailer: </b>" & data.trailer & "<br>
<b>Bill To: </b>" & data.billto & " - " & BillToName.Text & "<br>
<b>Consignee: </b>" & data.consignee & " - " & ConsigneeName.Text & "<br>
<b>Shipper: </b>" & data.shipper & " - " & ShipperName.Text & "<br>
<b>Location of Incident: </b>" & data.location & "<br>
<b>Description of Incident: </b>" & data.description & "<br>
<b>At Fault: </b>" & data.fault & "<br>
<b>Preventable: </b>" & data.prevent & "<br>
<b>Status: </b>" & data.status &"<br>
<b>Reported By: </b>" & data.reportedby & "<br>
<b>Report Group: </b>" & Concat(RptGrpDropDown.SelectedItems, Text(RptGrp) & " ")
);
Office365Outlook.SendEmailV2(
User().Email,
"Incident Submitted - " & data.incident_num,
"<b>Your incident has been submitted successfully</b>"
);
); // I added this bracket
Reset(cbCustomer);
Reset(cbEmployID);
Reset(cbOwnerOp);
ResetForm(NewIncidentForm);
Navigate(NewIncidentSuccess, ScreenTransition.Cover)
User | Count |
---|---|
202 | |
92 | |
83 | |
47 | |
42 |
User | Count |
---|---|
252 | |
105 | |
103 | |
62 | |
57 |