Create List Item

This activity creates a new list item on a SharePoint® site. See the tokens this activity produces.

To add this activity to a workflow definition

To configure this activity

Select the activity in the Designer Pane to configure the following property boxes in the Properties Pane.

See the following options:

  • Activity Name

    Once added to a workflow definition, the default name of an activity can be changed. Providing a custom name for an activity helps you remember the role it plays.

    To name an activity

    1. Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
    2. Select the activity in the Designer Pane.
    3. Under Activity Name in the Properties Pane, replace the default name.
    4. Note: Activity names cannot be the same as any other activity name in the workflow, they cannot be the same as the workflow's name, they must be less than 100 characters, they must contain at least one alphanumeric character, they cannot be "Name," and they cannot be the same as the activity's runtime type (which is usually only an issue with custom activities).

  • Activity Description

    Use the Activity Description to provide descriptive text to help you remember the role that the activity plays in the workflow. All activities contain a default description that you can modify while constructing your workflow.

    To modify an activity description

    1. Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
    2. Select the activity in the Designer Pane.
    3. Under ClosedActivity Description in the Properties Pane, replace the default description.
  • Server

    sharepoint, Sharepoint, SharePoint

    The ClosedServer property box allows you to specify which SharePoint® site the Create List Item activity will connect to and create a list item on.

    To connect to a SharePoint® site in the Web Service property box

    1. Add the Create List Item activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
    2. Select the activity in the Designer Pane.
    3. Under Server in the Properties Pane, select a SharePoint® server from the drop-down menu.
    4. Optional: To add, configure, or remove a SharePoint® server, select Manage Servers. More information.
    5. Optional: Click the refresh icon to update the list of SharePoint® servers available in the drop-down menu.
  • List Item

    The List Item property box, for the Create List Item activity, lets you add a list item to a SharePoint® site.

    To add a list item

    1. Add the Create List Item activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
    2. Select the activity in the Designer Pane.
    3. Under List Item in the Properties Pane, click anywhere in the property box.
    4. In the Edit List Item dialog box, use the List drop-down menu to select the SharePoint® list you want to add an item to.
    5. Optional: If the list you selected has subfolders, you can enter which folder you want to put your list item in next to Subfolders. Click the Token button (right arrow) to use tokens to specify a subfolder. If you do not specify a subfolder, the item will be added to the main list.
    6. Optional: If the list you selected is a document library, type a URL (such as a Web Access URL) next to URL. Click the Token button (right arrow) to use tokens. A text file with a URL extension will be created as the document for the list item being created. This allows a user to navigate to the URL you specified by clicking the document library link in SharePoint®.
    7. Note: You can type a file path next to URL to upload a copy of a document instead of specifying a URL. This document must be on your Workflow Server or a network drive that your Workflow Server can access. Note that files referenced in this way are not exported as part of a Workflow Import File.

    8. Click the Add/Remove Columns button.
    9. In the Choose Columns dialog box, select which columns you want your list item to have data in. Clear the checkboxes next to the columns you do not want to add data to.
    10. Note: An unselected column will be given its default value, if one has been specified, or it will be left blank.

      • To find a specific column, start typing the column name next to Name. Click the red X to clear your search results.
      • To only see the columns you have selected, click Only show selected columns. To see all columns, clear this checkbox.
      • To select or clear all the columns shown, select or clear the Select/Clear all checkbox.
    11. After selecting the desired columns, click OK.
    12. In the Edit List Item dialog box, select a column and enter a value for the column under Value. Click the Token button (right arrow) to use tokens. Repeat for each column you want to configure.
    13. Note: What you can enter under Value depends on the column type. For example, Date Time-type columns will only allow you to enter dates and/or times and Trustee-type columns will let you enter a user name.

      Tip: Hyperlink columns let you insert a link. Use this column type (in combination with the Generate Web Access URLs activity) to link to documents in Web Access.

    14. After entering a value for each column, click OK.
    15. Important: Required columns have an asterisk (*) next to their name. If you leave a required column's value blank, a validation warning will appear for the Create List Item activity. You cannot publish workflows with activities that have validation warnings.

Tokens for Create List Item

The Create List Items activity produces the following tokens.

Name Description Sample Syntax*
List Name The name of the SharePoint® list the item was created on. %(CreateListItem_List Name)
List Item ID The ID of the new list item. %(CreateListItem_List Item ID)
Folder The folder (if any) the new list item was created in. This token is replaced by a fully qualified URL. %(CreateListItem_Folder)
Root The name of the host Web service. %(CreateListItem_Root)

*The "CreateListItem" portion of the syntax changes to match the activity's name as specified in the Activity Name property box. Note that all non-alphanumeric characters, except underscores, are removed from the name. For example, if you rename the activity Add~SP~ the syntax for the Folder token will be %(AddSP_Folder).

Tokens for Custom Query and Query Data

The Custom Query and Query Data activities produce the following token.

Name Description Sample Syntax*
Results Found Whether results were found by the query. This token can have one of two values: True or False. %(CustomQuery_Results Found)
Result Count The number of results found with the Custom Query or Query Data activity. %(CustomQuery_Result Count)

*The "CustomQuery" portion of the syntax changes to match the activity's name as specified in the Activity Name property box. Note that all non-alphanumeric characters, except underscores, are removed from the name. For example, if you rename the activity Query "Database A_1", the syntax for the Results Found token will be %(QueryDatabaseA_1_Results Found).

The first row of the queried table are available as tokens

When a query is run, a token is created for each column in the table returned. Each token contains its column's value in the first row returned by the query. If you want to access tokens for additional rows, use a For Each Row activity.

To use first row tokens in the Workflow Designer, you must first test this query. Learn more about testing queries.

Name Description Sample Syntax*
Column Name A token is created for each column of the first row of the database table. The token name is the same as the column name. The token's value is the value in the Column Name column of the current row. %(CustomQuery_Column Name)

*The "Column Name" portion of the syntax changes to match the column name in the first row of the specified table. Note that all non-alphanumeric characters, except underscores, are removed from the name. For example, if you rename the activity Process [Rows], the syntax for the column named "Addresses" token will be %(ProcessRows_Addresses).

Column tokens available with the For Each Row activity

The Custom Query and Query Data activities also produce one token per column in the database table, which are available to activities inside the For Each Row activity. With the Custom Query activity you must use a SELECT query and test the query first to access these tokens. The For Each Row activity runs one time per row in the column. Each time it runs, the token value reflects the information relevant to the row it is currently processing.

Name Description Sample Syntax*
Column Name A token is created for each column in the database table. The token name is the same as the column name. The token's value is the value in the Column Name column of the current row. %(ForEachRow_Column Name)

*The "ForEachRow" portion of the syntax changes to match the activity's name as specified in the Activity Name property box. Note that all non-alphanumeric characters, except underscores, are removed from the name. For example, if you rename the activity Process [Rows], the syntax for the column named "Addresses" token will be %(ProcessRows_Addresses).