- My View
I don't think this is possible unless you know which fields are present in the individual section and you need to check every field.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
You can query the sys_ui_element table with the sys_ui_section field and get the list of fields present in that particular section.
A sample script I created is as below.
var gr = new GlideRecord('sys_ui_element');