Show / Hide Table of Contents

    SharePoint Interface Configuration

    Actions

    The following actions can be configured in the interface script of a method.

    Parameter Required Default Value Description
    Type yes The type of data that needs to be retrieved. Possible values:
    • ListName
    Name yes The title of SharePoint list. No GUID or internal name allowed.
    Action yes Specifies the action to perform in the SharePoint list. Possible values:
    • Select
    • Insert
    • Update
    • Delete: deletes the item permanently.
    • Recycle: if the recycle bin is enabled, it will move the item (document) to the recycle bin. If disabled, it will remove it.
    Filter optional CAML query to filter the list. More documentation about creating CAML queries can be found at MSDN or download the U2U CAML Builder.
    Example when to filter on the field Booked by:
    Filter=<Query> <Where> <Eq> <FieldRef Name='Booked_x0020_by' /> <Value Type='Text'>{$Booked By}</Value> </Eq> </Where> </Query>
    OrderBy optional Sort the list ascending or descending. More documentation about creating CAML queries can be found at MSDN or download the U2U CAML Builder.
    Example to sort the field Booked by descending:
    OrderBy=<OrderBy> <FieldRef Name='Booked_x0020_by' Ascending='False' /> </OrderBy>
    Scope optional DefaultValue Specifies the scope for returning list items and list folders in a list view. Possible values:
    • DefaultValue: enumeration whose values specify that all list items and all list folders in the current list folder are returned in the list view.
    • Recursive: enumeration whose values specify that all list items in the list are returned in the list view.
    • RecursiveAll: enumeration whose values specify that all list items and all list folders in the list are returned in the list view.
    • FilesOnly: enumeration whose values specify that all list items in the current list folder are returned in the list view.
    SearchViaLookupId optional true True to specify that any lookup fields used in the CAML query must be searched via their lookup id instead of the value.
    LookupReturnType optional Id Only applicable on SharePoint lookup and person or group field types . Specifies wheather to return the id, value or both. When both are returned, they are separated with ;#. A multi lookup field returns the id's separated with ;#;#. Possible values:
    • Id
    • Value
    • Both
    DatesInUtc optional false Specifies if datetime values must be returned in UTC format.
    StartInFolder optional When fetching, look for files in the specified folder. This must be a relative URL, e.g.: /sites/My Site/Shared Documents/My Folder
    This can also prevent list view threshold.
    For write actions, this is the folder where documents will be created / updated.
    IgnoredFieldsOnUpdate optional A comma separated list containing the input field names of the method which should be ignored during an update.
    By default, readonly fields in SharePoint can be updated via our interface. If you don't want this behavior, you can exclude those fields via this setting.
    Example to ignore the Title and Date fields when updating:
    IgnoredFieldsOnUpdate=Title,Date
    ActionForCheckedOutDocument optional Discard Specifies the action when the document is checked out. By default, the changes in a check out will always by discarded.
    • Discard: this is the default option: the changes in the check out will be discarded.
    • None: the item will not be updated when the item is checked out, an error message will be shown to the user.
    • OverwriteCheckIn: check in the changes of the current check out, overwrite the version of the document when checking in.
    • MinorCheckIn: check in the changes of the current check out, create a minor version of the document.
    • MajorCheckIn: check in the changes of the current check out, create a major version of the document.

    Fields

    The link between the SharePoint list and the field in the object or method is set in the External Name property. This property must be filled with the internal name, static name or title of the SharePoint column (checked in this order). If no match is found, the field will remain empty.

    Insert / Update

    The following fields will never be updated, even if they are configured in the external name property:

    • LinkFileName

    Examples

    Fetch All Items

    In this example all items from a SharePoint list are retrieved.

    • SharePoint List
    • Interface Script
    • Input Fields
    • Output Fields
    • Result

    This is the default tasks list view from SharePoint. The method in the Ometa Framework will retrieve these two items.

    SharePoint Tasks List

    The task list has multiple columns, the method will retrieve the following columns.

    SharePoint Tasks List Columns

    Notice LookupReturnType is set to Value because of the lookup and person or group field types.

    Type=ListName
    Name=Tasks
    Action=Select
    LookupReturnType=Value
    

    No input fields configured

    Field Type External name
    Assigned To Text Assigned To
    Completed Text Completed
    Created Text Created
    Created By Text Created By
    Description Text Description
    Due Date Datetime Due Date
    Modified Datetime Modified
    Modified By Text Modified By
    Percentage Complete Number PercentComplete
    Predecessors Text Predecessors
    Priority Text Priority
    Start Date Datetime Start Date
    Task Name Text Task Name
    Task Status Text Task Status

    Results

    Fetch Tasks By Assigned To

    In this example all the tasks are retrieved by some person.

    • SharePoint List
    • Interface Script
    • Input Fields
    • Output Fields

    This is the default tasks list view from SharePoint. The method in the Ometa Framework will retrieve these two items.

    SharePoint Tasks List

    The task list has multiple columns, the method will retrieve the following columns.

    SharePoint Tasks List Columns

    Type=ListName
    Name=Tasks
    Action=Select
    Filter=<Query><Where><And><Eq><FieldRef Name='AssignedTo' /><Value Type='UserMulti'>{$Assigned To}</Value></Eq><Neq><FieldRef Name='PercentComplete' /><Value Type='Number'>1</Value></Neq></And></Where><OrderBy><FieldRef Name='DueDate' Ascending='True' /></OrderBy></Query>
    

    Do keep in mind that the CAML query cannot contain line breaks. For readability, you can inspect the formatted CAML query below. More documentation about creating CAML queries can be found at MSDN or download the U2U CAML Builder.

    
    <Query>
        <Where>
            <And>
                <Eq>
                    <FieldRef Name='AssignedTo' />
                    <Value Type='UserMulti'>{$Assigned To}</Value>
                </Eq>
                <Neq>
                    <FieldRef Name='PercentComplete' />
                    <Value Type='Number'>1</Value>
                </Neq>
            </And>
        </Where>
        <OrderBy>
            <FieldRef Name='DueDate' Ascending='True' />
        </OrderBy>
    </Query>
    
    Field Type External name
    Assigned To Text Assigned To
    Field Type External name
    Assigned To Text Assigned To
    Completed Text Completed
    Created Text Created
    Created By Text Created By
    Description Text Description
    Due Date Datetime Due Date
    Modified Datetime Modified
    Modified By Text Modified By
    Percentage Complete Number PercentComplete
    Predecessors Text Predecessors
    Priority Text Priority
    Start Date Datetime Start Date
    Task Name Text Task Name
    Task Status Text Task Status

    Different Lookup Return Types

    In this example you see the different result sets when playing with the Lookup Return Type parameter.

    The lookup return type is only applicable on lookup and person or group field types. The predecessors field is a lookup field. The following fields are from type person or group:

    • Assigned To
    • Created By
    • Modified By
    • Id
    • Value
    • Both

    Lookup Return Type Id

    Lookup Return Type Value

    Lookup Return Type Both

    Back to top Copyright © OMETA
    Integrating systems ● Connecting people