Skip to main content

Search

Field validation - check values in separate list

Answered

Comments

1 comment

  • Matthias Walter

    Hi Adam Davies,

    to achieve this you can use the following Validation Expression. Simply replace the words in bold.

     

    [[@Web.QueryList('OtherList', '<Where><Eq><FieldRef Name="Title" /><Value Type="Text">[[Title]]</Value></Eq></Where>', 1, 'Title', '')]].length>0

    This case is valid if an item with the same title already exists in the other list. If you need it the other way around use this expression:

    [[@Web.QueryList('OtherList', '<Where><Eq><FieldRef Name="Title" /><Value Type="Text">[[Title]]</Value></Eq></Where>', 1, 'Title', '')]].length<1

     

    Cheers Matt

    0

Please sign in to leave a comment.