Additonal scope passed into query using start and end dates in moment()

Using
.trigger({ additionalScope: {monthNumber:i} }) in a js query

the resource is using
{{moment().subtract(monthNumber, 'months').startOf('month').format('YYYY-MM-DD')}}....

monthNumber is not being passed in/read....

Anyone have a similar issue?

I solved it by using a temp state...but am curious as to what is not correct in the above implementation.

Hi @ScottR !

We're experiencing some oddities with momentJS and Retool JS values. How are you currently using temp state?

I simply set the temp state in a loop in the js to increment the month number and then read that value back in after setting it...

Hi @ScottR

Does your implementation look like what I have here? I wasn't sure where monthNumber was coming from, so I just placed a digit and it seemed to work.
\

I wasn’t passing i. I used monthNumber as the variable. So I will try that and see what happens. Thank you