Retrieving values from Redux state
The C3 AI UI Framework uses Redux to store UI metadata and manage the state of your entire UI application. Redux is helpful when you need to retrieve runtime metadata about a component.
Retrieving values from Redux State
To find what values from Redux state can be used in your component, you can inspect the Redux state by installing the Redux DevTools extension. Once installed, open the Inspector tab and click on the State Tab. The State tab will help you visually see what values are stored in Redux store. In the C3 UI Framework, Redux state is split up by component ID, which matches the name of the .json file. In order to find the value in a component, you need to navigate to metadata > components > byId > <Name of your component> > <Component property> to find the value you want. For example, if you go to metadata> components > byId > SDL.DefaultSite > user, you can find all the fields of the user property associated with the SDL.DefaultSite component.
To use these values in your .json configuration, you can use the UiSdlComponentStateParam type. The UiSdlComponentStateParam has two fields, the id and path field which help you specify which component and property you want from that component. id refers to the name of the .json file and path refers to the path from id to the desired value.