Hey guys and gals, this is my first post in the community so be gentle with me :).
I am trying to get usage logs from an API and have no issue making the query itself.
The issue is that in order to get monthly data I need to send an individual request for each month.
It seems silly to create a query for each month by subtracting the month using moment.js and im sure there is a more dynamic way to go about this.
Essentially I want to make 6 request for this month and the previous 5 months, as an end result im looking to generate an array containing the month and the usage like so in order for me to use the data in a bar chart:
Hi EyalGershon
Great question! And welcome to the community!
I believe you could do something similar to what was asked in this community post: http://community.retool.com/t/how-to-loop-through-an-array-and-hit-an-api-for-each-value-in-a-column/4291/6
The idea is to loop over an array of items (this could be months) and then for each item in the array trigger the query you have already written. The month would then be dynamic and passed in as an 'additionalScope'. If you scroll to the bottom of the community post you will see a great overview on how to use this in a JavaScript Code query.