How can I Copying items from list to another based on created date field

  • 8 August 2017
  • 3 replies
  • 26 views

Badge +1

I am new to Nintex so I apologize if I do not get in all the details in my first question.  So here is my scenario:

I have two lists, list A and list B.  I need to see if it is possible to copy items from list A to list B based on the "Created" date field using a Nintex workflow.  I would like to have the workflow go through all the items in the list and determine (based on Created date field) which items to copy over.  Not sure of which action, "For Each" or Loop", or how to use them for that matter.  Sorry I am a newbie.  Any help is very much appreciated.


3 replies

Badge +16

Hi and welcome happy.png

A few questions:

  1. How do you want your workflow to start?  manually, automatically, scheduled weekly etc?
  2. What is the actual criteria you want around created date?  Created within the last 30 days for example

In general I would approach this sort of problem with a site workflow.  The site workflow would:

  1. query the list A and filter the records according to your requirement and put the ID field into a collection of IDs.
  2. For each ID in the collection, query list A again to get the columns needed to insert into list B
  3. Insert item in list B

I can definitely do you a demonstration if you let me know the columns in list A and list B and your criteria for the items that need copying?

Badge +1

Hi Cassy,

Thank you very much for reaching out I do appreciate it.  To answer your questions:

1. The workflow would start manually as this is a one time deal in this scenario.  Basically we forgot to create a new list based on fiscal year so just need to copy items from List A to List B which were entered at the beginning of our fiscal year (July 1st).

2. Need to copy any items entered after July 1st 2017 from List A to List B.

The list are identical in regards to the columns (from list template).  It has several columns I have included a short picture:

So basically I would like to copy any item in the list based on the system generated "Created" field from List A to List B.  Also, this list is email enabled which is how the items get created, not sure if that matters but wanted to give more info.  I would greatly appreciate the demo you spoke of and very thankful for your help.  Please let me know if there is more info you may need.  In the meantime I will try to figure out your site workflow recommendation.  Thank you very much.

-Nelson

Badge +16

No worries.  So I would approach this with a site workflow.

To create a site workflow go settings cog > Nintex Workflow 2013 > Create site workflow (Note:  depending on your version it may be in slightly different place).

Within your site workflow the first thing you want to do is query List A for all items where created date is greater than 01/07/2017.  I have used a date variable with that date as default in my action.  I have put all IDs returned into a collection variable.

Then I use a for each action to loop through my returned collection of IDs.  For each ID in my collection I use the copy item action to copy the item from List A to List B.

So my overall workflow looks like this:

once I published this I ran it by going site contents > site workflows > choosing the workflow and pressing Start.

Please shout if any of this doesn't make any sense.

Reply