Creating File Data Sets
5 Tasks
25 mins
Beginner
Pega Platform '24.2
English
Scenario
In the Sample application, a new Sample-Data-Countries class is created with the following Data Model:
Field | Type | Description |
---|---|---|
UniqueID |
Identifier |
Unique if of the country |
Country |
Text |
Name of the country |
A SampleCountries.csv file is available in the system for your convenience.
Create an embedded file Data Set with the SampleCountries.csv file, and then use the file to create an additional property available in the CSV file.
Create a File Data Set to access Countries.csv file in the repository.
Use the following credentials to log in to the exercise system:
Role | User name | Password |
---|---|---|
System architect | SystemArchitect | rules |
Your assignment consists of the following tasks:
Task 1: Download the CSV file to your local drive
The SampleCountries CSV file is available on the system through a binary file Rule. Download the file to your local drive.
Task 2: Create a new File Data Set for an embedded file
Create a new File Data Set named SampleCountries that contains the SampleCountries.csv file. Then, use the embedded file structure to create a new property called Abbreviation in the Sample-Data-Countries class.
Task 3: Preview the data in the embedded file
Browse the data that is available in the embedded file in the File Data Set.
Task 4: Create a new File Data Set for a repository file
Create a new File Data Set named Countries that contains the full list of countries.
Note: For the purposes of this exercise, a file repository (filerepo) is created for you. In the repository, the Countries.csv is available in the folder FileDataSet.
Task 5: Preview the data in the repository file
Browse the data available in the file repository.
Challenge Walkthrough
Detailed Tasks
1 Download the CSV file to your local drive
- Log in as the System Architect:
- In the User name field, enter SystemArchitect.
- In the Password field, enter rules.
- In the header of Dev Studio, in the search field, enter SampleCountries, and then click Search.
- In the list of results, click Countries SampleCountries CSV.
Note: For this exercise, the CSV file is stored in the system in a binary file for ease of access. Typically, files are stored in dedicated repositories.
- On the Rule form, click Download file to download the file to your local drive.
2 Create a new File Data Set for an embedded file
- In the navigation pane of Dev Studio, click App to open the Application Explorer.
- In the Application Explorer, search for the Sample-Data-Countries class.
- In the Application Explorer, right-click on the Sample-Data-Countries class, then select Create > Data Model > Data Set.
- On the Create Data Set tab, create a new Data Set:
- In the Label field, enter Sample Countries.
- In the Type list, select File.
- In the upper-right corner, click Create and open.
- On the Edit Data set: Sample Countries tab, complete the following settings:
- In the File location section, select Embedded file.
- In the File management section, click Upload file.
- On the Upload file window, click Choose File.
- Select the samplecountries.csv file that you downloaded in the initial task.
- On the Edit Data set: Sample Countries Rule form, click the Mapping tab. Note that there is the Abbreviation column does not have a mapped property.
- On the Mapping tab, click Create missing properties.
- In the Properties Generation window, click Create to create the missing property.
- Click OK.
- In the upper-right corner, click Save.
3 Preview the data in the embedded file
- On the Data set: Sample Countries tab, in the upper-right corner, click Actions > Run.
- In the Run Data Set: Sample Countries window, view the data:
- In the run context, in the Operation list, select Browse.
- In the upper-right corner of the run context, click Run to view the run results.
- Browse through the results.
- Close the Data Set Preview window.
- Close the Run Data Set: Sample Countries window.
4 Create a new File Data Set for a repository file
- In the Application Explorer, right-click the Sample-Data-Countries class, then select Create > Data Model > Data Set.
- On the Create Data Set tab, create a new Data Set:
- In the Label field, enter Countries.
- In the Type list, select File.
- In the upper-right corner, click Create and open.
- On the Edit Data set: Countries tab, complete the following settings:
- In the File location section, confirm that Files on repository is selected.
- In the Configuration section, in the Repository configuration list, enter or select filerepo.
- In the File path, enter /FileDataSet/Countries.csv.
- Click Preview file.
- Click Close.
- In the File configuration section, click Configure automatically.
- On the Edit Data set: Sample Countries Rule form, click the Mapping tab. Note that all columns have mappings.
- In the upper-right corner, click Save.
5 Preview the data in the repository file
- On the Data set: Countries tab, in the upper-right corner, click Actions > Run.
- In the Run Data Set: Countries window, preview the data:
- In the run context, in the Operation list, select Browse.
- In the upper-right corner of the run context, click Run to view the run results.
- Browse through the results.
This Challenge is to practice what you learned in the following Module:
Available in the following mission:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?