What is AppConfig?
The AppConfig object in ArcGIS Experience Builder is a JSON-based configuration for an experience. It contains all the essential settings and elements that define the application's behavior, layout, appearance, and data connections. This also includes properties for managing pages, layouts, widgets, data sources, and more.
AppConfig serves as a repository for all configurations related to the experience allowing developers to easily manage and customize the application. It is created when a new experience is initialized and is stored in the app
property of the application state.
How to update AppConfig
The AppConfig is immutable object. You update any configuration values by programmatically creating a new app
instance with the updated settings.
Below is an example of how to update the app
using the jimu-core
library during the widget runtime. You can programmatically dispatch the app
action to update the app
.
import { appActions, ReactRedux } from "jimu-core"
// get the appConfig
const appConfig = ReactRedux.useSelector((state: IMState) => state.appConfig)
// modify the appConfig
const newAppConfig = appConfig.setIn(["pages", pageId, "label"], theNewLabel)
dispatch(appActions.appConfigChanged(newAppConfig))
The most common way to update the app
is to update the widget config in the widget setting page where you programmatically call the props.on
. This function handles changes in the widget settings, and takes an object with the id
of the widget and the new widget config
as parameters.
props.onSettingChange({
id: widgetId,
config: newWidgetConfig
})
AppConfig structure
The App
object is a comprehensive JSON-based configuration that defines the entire structure and behavior of an experience. Here are some of its main properties:
Property | Description |
---|---|
dataSources | Specifies all data sources used within the experience. |
layouts | Defines the layouts used within the experience. |
pages | Contains the configuration for all pages within the experience. |
theme | URI of the theme applied to the experience. |
views | Configuration for views within the experience. |
widgets | Contains all widget configurations. |
Below is an example of a basic App
structure:
{
"connections": [],
"controllerPanels": [],
"dataSources": {},
"dialogs": {},
"exbVersion": "1.0.0",
"footer": {},
"forBuilderAttributes": {},
"header": {},
"historyLabels": {},
"layouts": {},
"mainSizeMode": "desktop",
"messageConfigs": {},
"name": "My Experience",
"originExbVersion": "1.0.0",
"pages": [],
"pageStructure": {},
"preloadWidgets": [],
"publishTimestamp": "",
"screenGroups": [],
"screens": [],
"sections": {},
"template": "",
"theme": "",
"timestamp": "",
"useAutoSortInFixedLayout": true,
"useCachedManifest": true,
"views": [],
"widgets": {},
"widgetsManifest": {}
}
Draft and published versions
In ArcGIS Experience Builder, the App
object is used to manage both the draft and published versions of an experience. The draft version is typically the working version that the app author uses to make changes, while the published version is the final version that users interact with.
For ArcGIS Online and ArcGIS Enterprise, the draft version of the App
object is stored in the app item resource while the published version is stored in the item data. This allows the app author to work on changes without affecting the live experience until they are ready to publish.
For the Experience Builder Developer Edition, the draft version is saved in the public/apps/
file, and the published version is saved in the public/apps/
file.