The new modern form editor is not giving the control names the same as the schema name of the field when you place the fields on the form using the new modern WYSIWYG form editor.
It generates the control names such as "Single-line_text_1" which does not make sense for the developers to reference with the actual field.
That makes it harder for us to find the control name and use in formContext.getControl("new_fieldname") for Control Client APIs suchs as (setVisible, setLabel, etc.)
How do you normally get the control name if repeated controls are presented on the form with _2, _3 or controls placed with modern form editor such as "Single-line_text_1"?
Browser DevTools (F12) or any other tool?
What is the best approach to get Control Control Client APIs for the fields placed on the form using modern form editor?
This is the best way I can think of but is there any better way?
formContext.getAttribute("new_fieldname").controls.forEach(function (control, index) { control.setVisible(false); });
Or we should not use the modern form editor to place the fields at all until the issue is resolved?