cancel
Showing results for 
Search instead for 
Did you mean: 

UI Designer Scripting: Check if field is null

former_member262937
Participant
0 Kudos

I need to hide a field if it is null, so I've added a calculation rule to the 'Visible' attribute of the fields: However, neither of the below are working (First always returns false, the second one always returns true). I need to know how to check if a field is empty/null:

*****************************************************

dataField = $data.PRDLinkInternalID

if (dataField == null)

result = false

else

result = true

end

**************************************************

dataField = $data.PRDLinkInternalID

if (dataField == “ “)

result = false

else

result = true

end

***************************************************

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee
0 Kudos

Hi,

Did you include your field for Invalidation Trigger script as in snapshot below? This make sure system execute the script written

Thanks

Saurabh

former_member262937
Participant
0 Kudos

This worked, thank you!

Answers (1)

Answers (1)

christinesmith82
Explorer
0 Kudos

I am doing something similar but I want the script to recalculate when the field is set. So I want a section to show when the field = show and hide when the field = hide. Is is possible to make the form dynamically change?

mychandan
Explorer
if($controller.Utils.IsInitial($data.fieldname))          //First Condition if blank Read-Only True
result = true;
else if(!$controller.Utils.IsInitial($data.fieldname))    //Second Condition if data have Read-Only False
result = false;
end