Read and Write records from the microshare datalake
Read data from the data lake
Your wokflow will usually start with reading data that was pushed to the data lake. This can be triggered automatically if your Robot was listening to a data stream recType, or periodically with a scheduled Robot.
Below are code snippets to read data from the data lake.
Read record triggering the Robot
Read the record that triggers the Robot using lib.read to get the data and metadata:
And the returned data model is
Read any record
You can also read any record from which you know the recType and/or id.
This call will always return an array and depending on the read, you can have more than one record returned.
To get records by the recType and associated tags:
Data lake advanced queries
You can use FACTS to do advanced queries to the data lake.
Facts run an aggregation query on the data lake entries and can take parameters. The returned format is the same as the read.
Write data to the data lake
As shown above, each step of a workflow usually ends with writting a record in the data lake.
A data write use is twofold: it builds the audit trail of your data, and allows to trigger the next step of the workflow.
As shown below, you can specify the recType and tags of your new data entry.