Skip to main content
Nintex Community Menu Bar
Solved

Send an email with list items

  • June 9, 2023
  • 7 replies
  • 376 views
  • Translate

Forum|alt.badge.img+3

Hi, 

I would like to create a scheduled workflow to gather the items that have been added to a Sharepoint List on the current day, insert it into an email as a table, then send to recipients. 

Thanks in advance!

Best answer by Garrett

Hi @ItsGavin 

Just to clarify your requirements

You want items that has been add → Does this mean just new List Items that has been created or also include updated List Items
New List Item → Query condition is Created field (DateTime Type)
Update List Items → Query condition is Modified field (DateTime Type)
Remove the second condition of you don’t need it.
Output variable is “SPO Query

 

You stated “insert it into an email as a table” → What is it? The item ID or the entire row of details?
You will need to create a For Each Loop using the output from the previous Query
SPO Query → Items 

Append the retrieve value into the HTML table using the Create String action.
Here we are adding one row of record. We include the ID, Created By and Create field (pls feel free to add or remove the fields

This code is just partial HTML Table. We have to finalize it with another Create String action outside the for each loop

 

You can include the variable txt_HTMLTable into the email content body.

 

The basic Workflow. Opps forgot the Send Email action at the end

 

View original
Did this topic help you find an answer to your question?

7 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • Answer
  • June 9, 2023

Hi @ItsGavin 

Just to clarify your requirements

You want items that has been add → Does this mean just new List Items that has been created or also include updated List Items
New List Item → Query condition is Created field (DateTime Type)
Update List Items → Query condition is Modified field (DateTime Type)
Remove the second condition of you don’t need it.
Output variable is “SPO Query

 

You stated “insert it into an email as a table” → What is it? The item ID or the entire row of details?
You will need to create a For Each Loop using the output from the previous Query
SPO Query → Items 

Append the retrieve value into the HTML table using the Create String action.
Here we are adding one row of record. We include the ID, Created By and Create field (pls feel free to add or remove the fields

This code is just partial HTML Table. We have to finalize it with another Create String action outside the for each loop

 

You can include the variable txt_HTMLTable into the email content body.

 

The basic Workflow. Opps forgot the Send Email action at the end

 

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 12 replies
  • June 9, 2023

@Garrett as per usual, you have solved all my issues! Thank you so so much! 

I do have 2 follow up questions:

In the SPO Query, I set “Created is on Current Date” it doesn't show any results, however, if I set it to “Created is before Current Date” it shows all results. How can I get it to only show results from today? 

Secondly, how can I get headers in the table?

Thank you!

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • June 9, 2023

Hi @ItsGavin 

For Date Comparison, what you think is date has actually 2 components the Date and the Time.

Many people are or get confuse Created is on Current Date

Created → Date Value is 1-Jun, Time is 10am
Current Date → Date Value is 1-June and Time is 12:00:00 am (00:00.00 am) HH:MM:SS

As such, usually NO results is return

 

 

More accurately if you wanted all items on 1-Jun, items would be in the range of 

1-June 12:00:00am and 2-June 12:00:00am 

 

 

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • June 9, 2023

For Table Headers, just add the orange colour text when you finalize the table

 

<table>
  <tr>
    <th>Column 1</th>
    <th>Column 2</th>
    <th>Column 3</th>
  </tr>

[txt_HTMLTable]

</table>

 

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 12 replies
  • June 9, 2023

@Garrett this all makes so much sense! Thank you again!

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 12 replies
  • June 14, 2023
Garrett wrote:

Hi @ItsGavin 

For Date Comparison, what you think is date has actually 2 components the Date and the Time.

Many people are or get confuse Created is on Current Date

Created → Date Value is 1-Jun, Time is 10am
Current Date → Date Value is 1-June and Time is 12:00:00 am (00:00.00 am) HH:MM:SS

As such, usually NO results is return

 

 

More accurately if you wanted all items on 1-Jun, items would be in the range of 

1-June 12:00:00am and 2-June 12:00:00am 

 

 

I have been wracking my head trying to find out how to do the date range.. But I just can’t work it out. Do you (or anyone else) have any tips please? :)

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • June 14, 2023

Here’s how to create the 2 date variables for a today date comparison 
Notice that the time portion is all zeros

Search for date items in the range between dt_CurrentDate and dt_NextDay.

 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings