Currently using If(datacardvalue28.selected.value="yes",true,false) in the required field option but doesn't not work

Currently using If(datacardvalue28.selected.value="yes",true,false) in the required field option but doesn't not work
if it's a choice type SharePoint column then in the required property:
DataCardvalue28.Selected.Value="Yes"
no need to write if block or false. Just this above line is enough
if it's Yes/No type sharepoint column then change it to choice type.