UI-Designer: Data Scope Activation
If DataScope handling is not activated, entire data model ( in the UI Component ) data is fetched from server.
e.g. If a Thing Inspector has 10 facets and each facet has a list. On load of the Thing Inspector, all 10 lists data is fetched from server. On load of thing inspector, only header and first facet are shown i.e. 9 facets data is unnecessarily fetched.
This adds to performance overhead in following ways:
- Unnecessary load on the server
- Large payloads transmitted over network
- Processing these large payloads on client
Activate data scope handling to fetch only data that is currently relevant (visible to user) from server.
To activate data scope handling for a UI component:
- Open the UI Component in SDK Studio
- In Properties section of the UI Component, Look for the field “Activate DataScope Handling” ( Highlighted in 1st image below)
- Change “Activate DataScope Handling” from “False” to “True”
- Test functionality and ensure that its working as expected
- Even though a section of data model is not part of current data scope, it can be made part of it by using Guard Conditions
- If fields used in script are not part of current data scope, those can be made part of it by scoping the fields ( see 2nd image below ). This cab be done as part of script operation configuration.
This information is very useful and much needed as a performance guideline for custom implementations. I have couple of clarifications :-
1) Can this adjustment be made only for Custom TIs, how about Standard TIs are there extensibility options available to control this or are these already adopted as Best Practice
2) Regarding the 2nd point on Guard Conditions and Scope fields, it is not very clear on the concept. Can you elaborate in the blog a bit more.