Hi all,
I am trying to write a FaaS function that saves it output in a dynamic Apps table using the datasourceToBePopulated
attribute. Unfortunatelly, the official documentation is very minimalistic and I am struggeling to do so. I’ve already managed to create a dynamic table and feed it with some initial values. I wrote a FaaS that would return some values that should be populated into this table and defined the Endpoint.
If I test the FaaS response in the Classic OD UI, it looks like
{
"stdout": "",
"stderr": "",
"response": {
"data": {
"col1": "test"
},
"schema": {
"name": "col1",
"type": "STRING",
"index": 0
}
},
"status": "SUCCESS",
"error": null
}
The function endpoint is has this entries:
"datasourceToBePopulated": {
"datasourceId": "datasource1",
"tableSchemaPath": "response.schema",
"dataPath": "response.data"
}
(I also tried to dismiss the response
in the Paths but it did not work).
But I always receive the error Error retrieving from datasource datasource1: Data could not be mapped to schema
and the inital values disapper from the dynamic table.
Does anyone know, how to specifiy the tableSchemaPath
and dataPath
? In which format should the data JSON be build. If you check, for instance, the Pandas.DataFrame.to_dict documentation, you will see, that there are 7 JSON like ways to store a table.