I want to display related fields based on what year I select. Let's say I have the said fields, named CG_2016, CG_2017, CG_2018, CG_2019, CG_2020. I have a dropdown of the said years, when I select 2020, I want to display the data for the fields, CG_2018, CG_2019, and CG 2020. I'm trying to do this in a gallery.
If I choose 2020, my Gallery would look like this:
I know I can simply do this by using an if statement for the visibility but my data table is expected to grow through the years, thus I was wondering if there are other possible solutions. Please help and thank you in advance.