set column mandatory based on another column's value in datasheet view in sharepoint 2013

ameneh maleki 46 Reputation points
2024-09-09T06:29:01.9466667+00:00

Hi

I create a datasheet view in sharepoint list. Now I want to mandatory one column based on another column’s value in this view.

How I can do this?

Thanks.

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Xyza Xue_MSFT 30,241 Reputation points Microsoft External Staff
    2024-09-09T08:06:03.8033333+00:00

    Hi @ameneh maleki ,

    You could set list validation to make a field mandatory based on a selection from another field in the sharepoint list. For example, when test2 field =1, test1 field is mandatory.

    1.Go to List settings -> Validation settings -> Use following formula:

    =IF([test2] = "1", IF(ISBLANK([test1]), false, true), true)
    

    184473-1.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. ameneh maleki 46 Reputation points
    2024-09-11T06:58:26.84+00:00

    Hi Xyza Xue

    Thanks for your reply.

    I didn’t have “Insert column” in Formula part in my sharepoint list setting page!

    and when i use this formula, get me below error:

    "The formula cannot refer to another column.  Check the formula for spelling mistakes or update the formula to reference only this column."

    What’s the problem?!

     

     2024-09-11_9-49-39


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.