Skip to main content

Importing data

1

Prepare your data

Prepare the raw data file that you need to bring into your project in Mangrove. Acceptable file formats include CSV, XLS, and XLSX.
  • Ensure you’re using the right import template
  • Populate all required columns in the template
    To streamline imports, ensure that data in the import templates reflect the correct formatting (e.g., date format or datetime format) and units (e.g., values in (%) should be between 0 to 100). A best practice is to “paste as value only” into the import templates to avoid copying external links and formulae into the template.
2

Upload the file

Upload the file into the corresponding Data Source in the Mangrove platform
  • Orders recorded for this customer will have the currency set as the default
  • Save contacts, and important information about the customer’s registry accounts
3

Review the loaded events

Events are transformed from your bulk import and populate the Analytics charts and Events Feed.
  • View event data: by selecting each event on the feed
  • Attach evidence files to relevant events: with Upload Evidence on each event
  • Filtering events: You can filter for specific event types and time ranges in the feed and on the Analytics charts
To check the status of ongoing bulk imports, visit the Data Inputs > Bulk Jobs section. If you encounter an error that you need assistance with, please reach out to Mangrove through your shared channel.
  • Reviewing issues with imports: Issues with bulk imports would be reflected as errored bulk jobs. Review the error message for more detail on the specific issue transforming the data in your bulk import file into Mangrove.
  • Cancel or Reverse an import: Mistakenly import wrong data? A completed bulk job can be Reversed. A bulk job that has already started can be Canceled - any existing data transformed from your import file will be deleted.
  • Retry an import

Data transformations

Transformations can be written by Admin users to be applied to every new file bulk imported from that data source. Transformations can be applied to bulk import files to generate events and evidences from them. See Transformation contract for the variables a script can read and the event object shape it must produce.

Transformation contract

A transformation is a Python script that runs once per import file. The execution environment exposes three top-level variables: A minimal script:

Event object shape

Each object appended to results represents one event. The fields below mirror what Mangrove’s transformation runtime accepts. Required Optional

Editing transformations on each Data Source

Admin users can define the event types that are generated from every Data Source through the Transformations Editor.
  • In Data Inputs > Input Settings, select an existing Data Source
  • Add transformation
  • Select an event type for data from the Data Source
  • Edit the Python transformation in the editor
Transformations are written in Python, and need to return a results array of objects representing the events to generate from the import data. An example is shown below:
Transformation
Here’s an example of what the results array might look like following execution of the transformation above:
results
Mangrove will process this result to create events in the Data Inputs > Events feed that can be used to run production models.

Using external packages in transformations

Apart from the Python standard library, Mangrove also supports a curated list of external packages that you can import and use in transformations:
  • mapbox
  • boto3
  • geopy
  • pandas
  • numpy