Skip to content

How to hide product form custom field it it has null value and show if it is notnull

I have a field named ‘soldout_date’ in product form. If it has null value then i don’t want to show the field in the form. But if it has some value then how to show??
I am using productmodifiers.

public function getSoldOutDate(array $options = [])
    {
        return array_replace_recursive(
            [
                'arguments' => [
                    'data' => [
                        'config' => [
                            'label' => __('SoldOut Date'),
                            'componentType' => Field::NAME,
                            'formElement' => Date::NAME,
                            'dataScope' => 'soldout_date',
                            'dataType' => Text::NAME,
                            'sortOrder' => 10,
                            'disabled' => true,
                        ],
                    ],
                ],
            ],
            $options
        );
    }

form field: https://i.stack.imgur.com/2IJGj.png