You are viewing limited content. For full access, please sign in.

Question

Question

Create SharePoint list item Workflow

asked on August 5, 2015

I am creating a leave form where the user can request paid time off and goes through an approval process.  If the date or dates are approved, the employee's name, date, # of hours, and type of leave is to be populated in a SharePoint calendar so anyone in the organization can see who is out of the office.  This works perfectly if there is only one day selected.  However, if multiple days are entered, all entries are repeated on the first day requested. 

The dates being requested are populated in a collection of fields where the user can enter more rows as needed.

 

The Workflow then should create a list item for each date value returned.

 

 

In SharePoint, the entry is created, but from the form above, instead of showing the dates of the 19th and 20th, the 19th is repeated twice on the first day.

 

Any help would be greatly appreciated! 

0 0

Answer

SELECTED ANSWER
replied on August 12, 2015

Oh, you're trying to iterate over rows in a Forms collection. Or is it a table?

Are you retrieving just the fields or the entire collection in Retrieve Form Content? You should be able to iterate over the entire collection with a For Each Row and get current value tokens for each field in the collection.

1 0

Replies

replied on August 5, 2015

What tokens are you using the Create List Item activity?

0 0
replied on August 6, 2015

Hello Miruna,

Here are the parameters I am using:

Create List Item:

Title - %(RetrieveLaserficheFormsContent_Employee_Name) %(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Drop-down) %(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Number)

Start Time - %(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Date)

End Time - %(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Date)

 

For Each Value - %(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Date)

 

The date value I am passing from the form to Workflow is being populated from a date field from within the form. 

 

0 0
replied on August 6, 2015

That's what I thought. You want to use the For Each Value equivalents of those so you get the current value at each iteration.

0 0
replied on August 11, 2015

Miruna,   That is what I would expect the answer to be, however, when working with the Start Time and End Time in the Edit Item List, the "For Each Value - Interation" is not available as it is for other fields. 

0 0
replied on August 11, 2015

If you click Token Dialog, are they listed there?

0 0
replied on August 12, 2015

When going to the Token Dialog, it does show iteration when for each value is expanded, however, I can't seem to build the proper token format to create the list item.  Here are examples of what i have tried.

(%(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Date)_Iteration)

%(ForEachValue_Iteration)

%(ForEachValue_Iteration)%(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Date)

%(RetrieveLaserficheFormsContent_Requested_Day_Off_Information\Date)%(ForEachValue_Iteration)

 

Here is a screenshot of available tokens:

0 0
SELECTED ANSWER
replied on August 12, 2015

Oh, you're trying to iterate over rows in a Forms collection. Or is it a table?

Are you retrieving just the fields or the entire collection in Retrieve Form Content? You should be able to iterate over the entire collection with a For Each Row and get current value tokens for each field in the collection.

1 0
replied on August 12, 2015

That's it!  It is a collection, not a table.  Once I changed from "For Each Value" to "For Each Row", the values became available as tokens.  Also, I did not notice the "Collection" option in the Retrieve LF Forms Content.  Thank you for all of your help Miruna!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.