In order for my form to submit with the correct data via email and SharePoint list, I have to use "LastSubmit" instead of "DataCardValue".
I am able to send all of the data via email and SharePoint list using LastSubmit with an exception of the attachments. How do you send attachments using LastSubmit?
Here is my code so far on the OnSuccess property of the form:
Office365Outlook.SendEmailV2(Form1_2.LastSubmit.'Requested By'.Email,
"New Request: " &Form1_2.LastSubmit.Title
, HtmlText1_2.HtmlText,
{Cc: Form1_2.LastSubmit.'Department Manager'.Email &";"& Form1_2.LastSubmit.'Department Director'.Email &";"&Form1_2.LastSubmit.'Hi Acute Director'.Email &";"& Form1_2.LastSubmit.'Business Sponsor'.Email
,Importance: "High"
,Attachments:
AddColumns(
RenameColumns(
DataCardValue42.Attachments,
"Value",
"ContentBytes"
),
"@odata.type",
""
)
}
);
ResetForm(Form1_2);