Data Portability
Extract user-related data and make it available for download
The paragraph app Data Portability is used to render data definitions in frontend, and allowing users to download the data. For creating data definitions go to the configurable app in backend.
Adding the app to a paragraph you need to:
- Select a data definition
- Select or create a form template for downloading and presenting the data
The form template requires you to use TemplateTags. A simple setup to display the data definition selected and its data groups could be:
<div>
<!-- Name of data definition -->
@GetString("DataDefinition.Name")
<!-- Loop over data groups -->
@foreach (var group in GetLoop("DataDefinition.Groups"))
{
@group.GetString("DataGroup.Name")
<ul>
<!-- Loop over data items types-->
@foreach (var itemType in group.GetLoop("DataGroup.ItemTypes"))
{
<li>Data item type: @itemType.GetString("DataItemType.Name")</li>
}
</ul>
}
<!-- Allow users to download the presented data definition -->
<form method="post">
<input name="DataAction" value="Download" type="hidden" />
<button type="submit"> Download </button>
</form>
</div>