I’ve got a question for the AG community. I’ve been working on a Google Chart for the past few days and running into an issue.
I’m trying to set the pageVars.chartData to numbers defined by two data variables on the same page. I can’t get the chart to display properly and am wondering if there is a better way to go about it.
I’ve tested the chart with static numbers and it works just fine, so it’s not the chart setup itself.
I’ve tried setting the pageVars.chartData upon page load using the logic function Set Page Var with the two data variables. I’ve also attempted the same logic sequence upon button submit.
Neither appears to be working so I’m wondering if you are not able to set a Page Var with a Data Var on the same page.
For additional context, on the page that is displaying the chart, I have it where those data variables are updated on a button submit. I’m hoping to display the chart both upon page load and then after a user clicks on a button to display the change in the Google Chart.
Could it be a race condition where when you’re setting
pageVars.chartData as part of your logic, the data variables are not yet populated by the data fetch logic?
It turns out I’d put the data variables in an Object data variable and that was the issue. I just made separate data variables versus keeping them nested in an object data variable.
Still trying to wrap my head around how to properly use Object & Array data variables and how best to create nested or embedded data resources.
Any recommendations on how to best grasp these concepts? And understand when to use a new data resources and how to tie one data resource to another?
I’d like to start adding gamification elements and am struggling to conceptually understand how to structure the data resources. For example should it be a completely separate data resource and if so then how do I tie milestones/actions into the new data resource.
I’m really loving how quickly the learning curve is with AppGyver!
As this IS software development at its core, the right answer for data structure is not often clear but more a matter of the requirements of the specific use case. Furthermore, the current implementation doesn’t really have a packaged way of handling relations between data, so once your schemas start to get complex and interlinked, it requires a bit of custom work to make everything function as intended. Preferably, your backend would handle the relations and provide the data to you already mangled to the correct format, but that’s not always an option.
If you start a new thread describing your data model and how different resources should be linked together, we’re happy to provide assistance!
Thanks @Harri_Sarsa! I’ll flesh this out a bit more and make sure it’s clear before posting in a new thread.