Skip to main content

Search

Forms expression to query SharePoint list

Answered

Comments

1 comment

  • Matthias_Walter

    Hi Gareth Jayne,

    you can use the following function to query the ID of the newest item in a list:

    [[@Web.GetFirstValueForQuery('Contacts', '<Where></Where><OrderBy><FieldRef Name=Created Ascending=False /></OrderBy>', 'ID')]]

    Just use an empty <Where></Where> query and order by the field 'Created' descending.

     

    or use this to get the latest item ID created by you:

    [[@Web.GetFirstValueForQuery('Contacts', '<Where><Eq><FieldRef Name=Author LookupId=True  /><Value Type=User ><UserID/></Value></Eq></Where><OrderBy><FieldRef Name=Created Ascending=False /></OrderBy>', 'ID')]]

     

    This function is available in the expression builder under the web context object.

     

    Kind regards

    Matthias

    0

Please sign in to leave a comment.