Hi Alexandre,
I was able to achieve this using arrays. I defined a global script object to retrieve and return data as a string, which would take in a single year. I also defined an array of the years (string array) and used a for loop to call and append each value within another string. Finally, I used a setText to display these values within a text component.
I have attached the screenshots and the scripts used.
Thanks and Regards,
Eshwar Prasanna