I want to do an IF statement and if its true then I want another column to be set.. I am using list validation on a Sharepoint list:

=IF([Master vs Copy])="Master",([Duplicate Rationale])="None"), TRUE) 

So the column called 'Duplicate Rationale' is a choice column and I want to set it to value None (which is in the columns).

Any help would be brilliant as I don't know how to set a column in list validation.

3 Answers 3


We can use jQuery code to achieve it.


I create a custom list with the choice columns "Master vs Copy" and "Duplicate Rationale".

Then add the code below into script editor web part in the newform.aspx page.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
function PreSaveItem(){ 
    var masterVsCopy=$("select[title='Master vs Copy']").val();
    var duplicateField=$("select[title='Duplicate Rationale']");
    if(masterVsCopy == "Master"){
        $("select[title='Duplicate Rationale']").val("None");
        alert("Please select a value of Duplicate Rationale field.");
        return false;
    return true;

enter image description here

  • perfect but not possible with Sharepoint online is it ?? Mar 1, 2019 at 12:47
  • SharePoint Online classic also works, in modern list, we can't add custom JavaScript in list form page.
    – LZ_MSFT
    Mar 4, 2019 at 1:10

You cannot set with Column Validation another column. Just Create Duplicate Rationale like Calculated column and here fill this expression:

=IF([Master vs Copy])="Master","None", "")


You cannot set the list column in validation formula.


  1. Create a calculated column with name Duplicate Rationale.

  2. Use below formula for your calculated field:

    =IF([Master vs Copy])="Master","None", "OtherValue")


  1. Calculated Field Formulas.
  2. How to create calculated columns.

Is there any other reason for using choice column?

  • because if Master vs Copy is equal to copy then Duplicate Rational has to have content. Feb 27, 2019 at 14:44
  • What is the type of master vs copy? Feb 27, 2019 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.