FAQ schema for CMS

Guys, I’m in trouble and need help. My client has a huuuuge blog posts which have different amount of FAQ. We need to add these questions to schema. I did an hours of researches, gpt, logic, but can’t fix this issue: I created 10 question and 10 answer fields. Used json schema. everything works well, but!!! Each page have different amount of questions. One page 3FAQ, one 7 FAQ etc. and empty fiels are shown in a google console and schema.org validator. Client wants to show only filled fields. I tried to add conditions but it’s not work. The code I used:

and it’s not working at all. Maybe you had an experience adding a different amount of FAQ for cms schema? please, share your thought and ideas!!!

Switch to using RDFa or Microdata. Google processes it just as well and it’s far more compatible with Webflow’s collection list design.