ClearCollect(
colFilteredEmails,
Office365Outlook.GetEmailsV3(
{
folderPath: "Inbox",
searchQuery: "subject:[Documentation Reminder] AND (subject:[1st] OR subject:[2nd]) AND subject:[" & 'Notification Gallery'.Selected.'<redacted> Number' & "]",
subjectFilter: Blank(),
from: Blank(),
to: Blank(),
cc: Blank(),
toOrCc: Blank(),
importance: "Normal",
fetchOnlyUnread: false,
fetchOnlyWithAttachment: false,
includeAttachments: false,
top: 3,
skip: 0
}
).value
);
UpdateContext(
{
varEmailHtml: Concat(
colFilteredEmails,
"<h3>" & ThisRecord.subject & "</h3>" & "<p><strong>From:</strong> " & ThisRecord.from & "<br>" & "<strong>To:</strong> " & ThisRecord.toRecipients & "<br>" & "<strong>Cc:</strong> " & ThisRecord.ccRecipients & "<br>" & "<strong>Received:</strong> " & Text(
ThisRecord.receivedDateTime,
"yyyy-mm-dd hh:mm"
) & "</p>" & "<div>" & ThisRecord.body & "</div>" & "<hr style='border: 0; border-top: 2px solid #0078d4; margin: 30px 0;' />"
)
}
);
//If(IsBlank(Dropdown2_2.Selected) Or IsBlank(Dropdown2_1.Selected), DisplayMode.Disabled, DisplayMode.Edit)
If(
IsBlank(TextInput7.Text),
DisplayMode.Disabled,
If(
And(
// 2. Validate Primary Email & Department
IsMatch(
TextInput7.Text,
"^[a-zA-Z0-9._%+-]+@<domain>\.org$",
MatchOptions.IgnoreCase
),
IfError(
IsMatch(
Office365Users.UserProfileV2(TextInput7.Text).department,
"<redacted>|<redacted>|<redacted>",
MatchOptions.IgnoreCase
),
false
),
// 3. Validate Cc Email & Department (ONLY if it is not blank)
Or(
IsBlank(TextInput7_4.Text),
And(
IsMatch(
TextInput7_4.Text,
"^[a-zA-Z0-9._%+-]+@<domain>\.org$",
MatchOptions.IgnoreCase
),
IfError(
IsMatch(
Office365Users.UserProfileV2(TextInput7_4.Text).department,
"<redacted>|<redacted>|<redacted>",
MatchOptions.IgnoreCase
),
false
)
)
),
Or(
IsBlank(TextInput7_3.Text),
And(
IsMatch(
TextInput7_3.Text,
"^[a-zA-Z0-9._%+-]+@<domain>\.org$",
MatchOptions.IgnoreCase
),
IfError(
IsMatch(
Office365Users.UserProfileV2(TextInput7_3.Text).department,
"<redacted>|<redacted>|<redacted>",
MatchOptions.IgnoreCase
),
false
)
)
),
Or(
IsBlank(TextInput7_5.Text),
And(
IsMatch(
TextInput7_5.Text,
"^[a-zA-Z0-9._%+-]+@<domain>\.org$",
MatchOptions.IgnoreCase
),
IfError(
IsMatch(
Office365Users.UserProfileV2(TextInput7_5.Text).department,
"<redacted>|<redacted>|<redacted>",
MatchOptions.IgnoreCase
),
false
)
)
),
Or(
IsBlank(TextInput7_6.Text),
And(
IsMatch(
TextInput7_6.Text,
"^[a-zA-Z0-9._%+-]+@<domain>\.org$",
MatchOptions.IgnoreCase
),
IfError(
IsMatch(
Office365Users.UserProfileV2(TextInput7_6.Text).department,
"<redacted>|<redacted>|<redacted>",
MatchOptions.IgnoreCase
),
false
)
)
),
Or(
IsBlank(TextInput7_7.Text),
And(
IsMatch(
TextInput7_7.Text,
"^[a-zA-Z0-9._%+-]+@domain>\.org$",
MatchOptions.IgnoreCase
),
IfError(
IsMatch(
Office365Users.UserProfileV2(TextInput7_7.Text).department,
"<redacted>|<redacted>|<redacted>",
MatchOptions.IgnoreCase
),
false
)
)
)
),
DisplayMode.Edit,
DisplayMode.Disabled
)
)