How to dynamically filter multichoice field

We have a multi select choice field in SharePoint; based on some other field value we need to filter the multichoice field. I tried to update the field via widget.setDataSource but it returned an error "widget is undefined".

Thanks for your help

Hello @Zusbry

Could you confirm the product, please? Is it Plumsail Forms?

Best Regards,
Petr Bushuev
Plumsail team

@Petr I'm sorry, yes it is Plumsail form.

Thank you