Skip to main content

Hello,

how could i setup a workflow which runs only once a month and collect all entries in a list which has an date in this actual month?

a short example:

I have a list with date column, one list element has an date 11.03.2016, another is 18.03.2016 and the third one is 25.03.2016.

Now I want a workflow, which runs on the last day of the month and send me a list with all entries where the date is in this month. (and only they, not the from the last month)

Nice would be an list with Hyperlinks to the respective element.

I hope you can follow my explanation?

Hi Sebastian,

you will need to create a site workflow. This site workflow can be scheduled to run once a month.

Use a "Query list" action to get all the IDs from the items of your list. Store the IDs inside a collection variable and use a "For each" action to loop through your IDs. Inside the loop you can then use another "Query list" and configure its filter to only get the values for the item where the item ID is your current ID in the loop.

To determine whether the entry in the items date column is in the current month, you can use a "Calculate date" action. You can take the current date, substract 30 or 31 days and compare it to the fields value.

For the list of links to the elements, you can take the "Server Relative URL" field inside your "Query List" action, store it in a variable and create your list of hyperlinks in the format you require. For example you can use a "Build String" action inside your loop to build a string containing all the hyperlinks and send an email containing this string.

Regards

Philipp


Hello Philipp,

this sounds quite reasonable everything!;-)

Only unfortunately, I am not yet so really familiarly within Nintex.

Could you possibly outline such a workflow?

Thanks alot in in advance

Sebastian


Hi Sebastian,

since you are the first one that called my suggestions "reasonable", I will provide a small instruction as a reward wink.png

I presume you are using SharePoint 2013 on Premise, but should be quite the same on different environments.

1. Create/Schedule site workflow

Both will be done via the gear menu on your SharePoint site

Capture.JPG

2. Calculate Date

Use a "Calculate date" action to calculate a variable that stores the first day of the month.

Capture.JPG

The difficulty is to decide whether the month has 30 or 31 days (or even less if its february). So you will need to check how many days the current month actually has and either add -30 (negative number will substract from the input date) or less days. Can't think of a trivial solution for this right now, it's quite late already...

Maybe a regular expression to extract the number of days from the current date and then check if it's a 30 or 31 or less and have conditional workflow paths afterwards could be a solution.

3. Query your list

Use the "Query list" action to query all items from your list

Capture.JPG

Make sure you use the "current date" workflow context variable and your newly created variable as a filter, so you will only get back items where the date is inbetween these two dates, as suggested in the screenshot above. Be aware that I filtered for the "App Created By" column, of course you would enter your specific date column.

At the bottom of the action you choose the "Server Relative Url" to receive back and store all of the URLs in a collection variable. It has to be a collection variable, because you will get more than one url back from the query.

Capture.JPG

4. Create list of URLs

Use a "For each" action to loop through your "url_collection" variable and store the current URL in a text variable (here called "url").

Capture.JPG

Inside the loop you can use a "Build string" action to create a list of all the URLs.Capture.JPG

Afterwards you can send the variable "list_of_urls" by mail or log it to the workflow history list or do whatever is appropriate to you.

I hope this gives you something to start with.

Regards

Philipp


Thanks alot!

is there a way to get an hayperlink to the individual element? Because the "Server Relative URL" is something like:

http://SharepointServer.Domain/bla/bla/TESTList/1_.000 and thats nothing to click on?!

But everything else works perfect!

Thanks again!

EDIT:

I`ve got somthing I need here: How to get item URL from another list


Your welcome. The thread you linked describes exactly what you need. So you don't query your list for the server relative url but for the ID of the item. Afterwards you use the build string action to build the url to the item in the form of:

Site URL/lists/List Name/DispForm.aspx?id=ID

As "Site Url" you can use the workflow context variable. As List Name you just enter the name of your list. You can't use a context variable here, because you will only have the "List Name" variable available in list workflows. And as ID you use the ID you queried in your query list action.

Regards

Philipp


Reply