2

When someone asks some vacations, i have to create items in a sharepoint list...one item per days...is it possible with a workflow to create multiple items?

Lambda situation:

The user creates a list item to ask for some vacations... there, an approval workflow is launched...

If the first workflow returns an approval; i need to create, in another list, one item per day to develop the vacations.

Ex: User asked for vacations from 12/20 to 12/30

after approval, in the second list it needs to create:

12/20 | user-name | vacation type
12/21 | user-name | vacation type
12/22 | user-name | vacation type
  .
  .
  .
12/30 | user-name | vacation type

Is it possible?

  • Can you please extend the question so that it is more clear what you want to achieve. – Robert Lindgren Dec 19 '13 at 14:33
  • Are you using SP 2013 or SP 2010? – Alok Kumar Gupta Mar 23 '17 at 10:32
1

If you are using SP2013 workflows there is a loop construct that you can use after calculating the different between the start and end date. In the loop just create the list item for each day.

If you are using SP2010 workflows there isn't a loop so you need to be a little more creative (create a hack). It is possible to have two workflows trigger each other and in effect create a loop. You would use that to have the create list item called.

Or another approach would be to just have a series of if conditions in the one workflow and have an upper limit of possible days. This would require that you create an if condition for each day and copy the create list item action (tedious).

1

Yes we can create a second list as required. So the workflow goes this way:

  1. Start a task process/ Approval process -- And if the out come is Approved, then do the following:

    a. Start a loop with variable "Noofdays" times (calculated column) You can get that Here

    b. Inside the loop, use create a item in List (output to variable: create1) action to create a new item into the second list. Here you can map what fields you want to show in second list from the first list. After mapping Increase the Start Date by 1 day and set that output value to Start Date Again. (in this way you can give looping condition as When Start date Equals End Date because we are Adding 1 day every time it enters the loop)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.