@WarrenBelz @RandyHayes I have a simple If statement which I know evaluates to true yet the Office365Outlook.SendEmailV2 function refuses to run 😞
This is what is not working - i.e no email is generated: DataCardValue8 is a Toggle and DataCardValue139 is a ComboBox
If(
DataCardValue8.Value = true && DataCardValue139.Selected.Value = "Sport and Recreation",
Office365Outlook.SendEmailV2(
varRecord.supervisor & ";" & "secondemail@qld.qld.gov.au; thirdemail@qld.qld.gov.au",
varRecord.firstname & " " & varRecord.surname & " has submitted a " & DataCardValue87.Selected.Value & " Report ID " & varRecord.ID & " on behalf of " & varRecord.'PI-firstname' & " " & varRecord.'PI-surname',
If(
DataCardValue87.Selected.Value = "Hazard",
HtmlTextforHazard.HtmlText,
HtmlTextforIncident.HtmlText
),
{
Cc: varRecord.manager & ";" & varRecord.'email-address',
Importance: "High"
}
),"")
I know the If statement evaluates to true cos I have put the following code on the Text property of a button:
If(DataCardValue8.Value = true && DataCardValue139.Selected.Value = "Sport and Recreation" ,"Yes", "No") and the Text display of the button is Yes.
If I change the If statement to the following, it works perfectly
If(
1=1,
Office365Outlook.SendEmailV2(
varRecord.supervisor & ";" & "secondemail@qld.qld.gov.au; thirdemail@qld.qld.gov.au",
varRecord.firstname & " " & varRecord.surname & " has submitted a " & DataCardValue87.Selected.Value & " Report ID " & varRecord.ID & " on behalf of " & varRecord.'PI-firstname' & " " & varRecord.'PI-surname',
If(
DataCardValue87.Selected.Value = "Hazard",
HtmlTextforHazard.HtmlText,
HtmlTextforIncident.HtmlText
),
{
Cc: varRecord.manager & ";" & varRecord.'email-address',
Importance: "High"
}
),"")
any assistance greatly appreciated
I have solved the mystery I changed my If statement to:
If(
varRecord.'Business Unit'.Value = "Sport and Recreation" && varRecord.'sport-facility'=true,
and Powerapps is happy
Hi @v-hanytian-msft tried with the 1st one - didn't work, then tried with the 2nd one - didn't work either - I am stumped!
Hi @bobgodin ,
We recommend that you fill in only one condition to filter which condition is having the problem.
For example:
If(
DataCardValue8.Value = true,
Office365Outlook.SendEmailV2(
varRecord.supervisor & ";" & "secondemail@qld.qld.gov.au; thirdemail@qld.qld.gov.au",
varRecord.firstname & " " & varRecord.surname & " has submitted a " & DataCardValue87.Selected.Value & " Report ID " & varRecord.ID & " on behalf of " & varRecord.'PI-firstname' & " " & varRecord.'PI-surname',
If(
DataCardValue87.Selected.Value = "Hazard",
HtmlTextforHazard.HtmlText,
HtmlTextforIncident.HtmlText
),
{
Cc: varRecord.manager & ";" & varRecord.'email-address',
Importance: "High"
}
),"")
Best Regards,
Tina
Hi @v-hanytian-msft there is no error message - the SendEmail function just doesn't run - it's like it doesn't evaluate the If statement correctly
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.