question

RJF-4684 avatar image
0 Votes"
RJF-4684 asked AmosWu-MSFT commented

Formatting Content in Workflow Email

Hello,

Is it possible to conditionally format email content that is generated from a SharePoint workflow? I have a field (# of Workdays) that I would like to highlight in the Workflow email based on the value. For values less than 5 = Red, values greater than 5 and less than 13 = yellow and greater than 13 = green.

Is there a method to accomplish?

Thank You

office-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AmosWu-MSFT avatar image
0 Votes"
AmosWu-MSFT answered AmosWu-MSFT commented

SharePoint workflow has a condition option, we could use this to do the logical operation.

  1. Define a workflow number variable to get the workdays column value.

  2. Define a workflow string variable as the body of the email.

  3. Judge the number value and set the email body of different color.
    73664-image.png
    73673-image.png
    73681-image.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (18.8 KiB)
image.png (19.3 KiB)
image.png (19.3 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RJF-4684,
I am checking to see how things are going there on this issue. Please let us know if you would like further assistance.
You can accept the helpful post as the answer to help other community members find helpful information quickly.

0 Votes 0 ·

Hi @RJF-4684,
Do you have any update on this issue?

0 Votes 0 ·

Hello @AmosWu-MSFT,

Sorry for the delayed response.

I'm curious how I incorporate this with the workflow I use to send the email. Do I merely add additional Steps (are they in series with these steps or a parallel operation)?

Thanks

0 Votes 0 ·

The general idea is to use the workflow condition option to splice different HTML sentences according to the value range and control the font color, and finally put the spliced sentence in the email body, and the font color of that part will change after the email is sent.
Just finish the string splicing before the send email action.

0 Votes 0 ·