- 1. Summary
- 2. Step by Step Guide
- 2.1 Create the DSO
- 2.2 Generating Entity, Fields and Grid from Mock-up DSO
- 3. Documentation
1. Summary
A DataSource is used to populate data in components in Build.One like Grid / Table or Card View , This data can be stored in a real Database or like in this case, in a JSON file. This is specially useful in the first drafts of a project, as sample data can be included and test how the application looks and feels.
2. Step by Step Guide
2.1 Create the DSO
- To start you need a json-file which holds your mock-up data, an example for customer data can be found here:
- This json file must be included in the workspace, e.g.
src/webui/assets/resources/mockdata/Customer_MockUp_example.json
- If not already there you can create that folder, but the folder must also be exposed. This could be done here
src/webui/webpack/config/static.config.js
by adding the following lineexport default [{ from: 'assets' }];
- After that you can create your DSO in the B1 UI and adjust the following attributes
MockupData
→ Put in the path where to find the json-file, in our example this would be/resources/mockdata/Customer_MockUp_example.json
SUBTYPE
:MockupCollection
- Now you can use you DSO like a all the other DSOs
MockUp Example.json0.8KB
2.2 Generating Entity, Fields and Grid from Mock-up DSO
- You can either create the Entity, Fields, Grids and Forms manually out of the Mock-up DSO or you use the build in tools. In case that you want to use the build in tools, continue with the next steps
- For creating Entities and Fields: Use the function
Generate Entities & Datafields
which you can find in the toolbar ofIntegrate -> Data -> Datasources
- Give it a
Name
,Description
andModule
- Choose
JSON
asDefinition Source Type
- Paste in your predefined json-file, make sure that there are no spaces in the parameters
- Click
Ok
and see success message - For creating Forms and Grids you can use the
Generate
Function eighter inDesign -> Components -> Grids
orDesign -> Components -> Forms
3. Documentation
To find more information and all the possibilities available, you can check the following documentation.
Back to Use Cases
Back to Home Page