Source All Needs Assessment Summaries, Broken Down by Quarter & Region #90
-
Hey @coderbyheart, given the way Gatsby works and what we need for the landing site, it'd be easiest if we could source all needs assessment summaries broken down by quarter & region. That'd limit the amount of data I'd have to hard-code to make the requests, and help future-proof the Gatsby import code if we add new regions, etc. I'm imagining something like the overall summary query from #62, but the json results would be broken down in a way similar to this:
Similarly if you request just 1 quarter it'd break the data down by region, or if you request just 1 region it'd bread the data down by quarter. I'd recommend extending the existing API by adding a "details" parameter to access these breakdowns. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Sourcing "all" needs assessment will be a problem, because those contain also responses for testing / preview forms. How about the API can summarize multiple forms, however a list of known good IDs have to be provided, so the only thing that changes when a new needs assessment form is added is to add it's id to the query? For example, instead of a single form summary using The endpoint would combine the data from these two forms, and add up the values for answers with the same ID. For example: From "foodItems":{"rice":{"kg":248830} From 01GCW8TQFCE92TR1NXH8NEET7F: "foodItems":{"rice":{"kg":3950}, Into: "foodItems":{"rice":{"kg":252780}, |
Beta Was this translation helpful? Give feedback.
-
Hey @coderbyheart! I think we're talking about two different things here, let me clarify: I want to be able to query the data for a single survey (e.g. Does that make sense? It's less of an issue for me to request multiple surveys. I can implement a whitelist of good survey ids on the gatsby side and loop through that, making 1 request per survey. |
Beta Was this translation helpful? Give feedback.
Hey @coderbyheart! I think we're talking about two different things here, let me clarify:
I want to be able to query the data for a single survey (e.g.
https://storage.needs-assessment.distributeaid.dev/form/01G4X7XTMCD6MFHDT5KS7Z27GF/summary
) but NOT have the data summed overall. Instead, it'd be helpful to get each region's summary listed. If there's only 1 survey per quarter then I don't need things broken down by quarter as well, though it'd be helpful to have the year / quarter listed in thestats
attribute. But if we reuse a survey for multiple quarters then I will need the data broken down by quarter as well.Does that make sense?
It's less of an issue for me to request multiple su…