I have a SharePoint list which have two columns named Province and Hospital, Province is a single text column and Hospital is a lookup column.
The request: When Hospital is empty, Province must has value.
For now, I tried to create another single text column Hide_Hospital and using the Json formatting with below Json to get the value of Hospital.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"flex-wrap": "wrap",
"display": "flex"
},
"txtContent": "[$Hospital.lookupValue]"
}
And then use formula in validation settings with below formula:
IF(ISBLANK([Hide_Hospital]),IF(ISBLANK(Province),FALSE,TRUE),TRUE)
But when I create a new item in the list, the validation was did before getting the value of Hospital, is there any suggestion here?