Hello,
I'm quite new in the development of widgets for WAB. I use ArcGIS enterprise portal 10.6 and WAB developer edition 2.10.
I have an application that uses data that is updated every two weeks or every month. For every new batch of data I replace the FGDB in the registered folder and the next time the users open the application, it shows the new data. As part of the application, we have a Filter widget that filters the Year field (integer) and the Month field (integer). Since most of the users want to check the last month data, the default values of the filter have to be the last month and year. Until now, every time we receive new data, we enter the application, manually change the default month and year of the filter, save and copy the application to the right folder in the IIS server.
I'd like to automate that process so the filter widget in the application checks the data, finds the last month and year and sets the default values of the filter.
A simple approach could be a script, external to the application, that reads the new data and do some changes to the filter widget JSON, as shown in the next lines:
"parts": [
{
"fieldObj": {
"name": "Year",
"label": "Year",
"dateFormat": "",
"shortType": "number",
"type": "esriFieldTypeDouble"
},
"operator": "numberOperatorIs",
"valueObj": {
"isValid": true,
"type": "unique",
"value": 2020
},
"interactiveObj": {
"prompt": "Year is",
"hint": "",
"cascade": "previous"
},
"caseSensitive": false,
"displaySQL": "Year = 2020",
"expr": "Year = 2020"
}
],
This is easy to achieve but is not the automation I'm willing to use.
Instead, I'd like to find where the configuration data, read from the above JSON file, resides within the application and change it programmatically every time that the application opens/loads the filter widget - I guess it should be in the PostCreate function, using the Query function.
I've looked for it in the debugger and couldn't find where the data is, so I'm kindly asking for your assistance.
Thank you in advance,
Marcelo