Hey,
Scripted Connectors already provide the capability to automatically add a FK to a table, when using nested arrays. (https://docs.dataminer.services/user-guide/Advanced_Modules/Data_Sources/Data_API.html#support-for-tables)
Are multiple FKs into a single table also supported, and how can that be achieved? Currently, we tried by nesting the same object into the 2 different table arrays, but we get following error. The ChargeSessions is the object that is nested into the 2 different tables, but is the identical object.
"Array 'ChargeSessions' should have all objects with the same number of fields."
Hi Leander,
Can you clarify what you mean by multiple FKs in a single table?
Is it having a "Main" table and then a "Secondary" and "Tertiary" table each pointing to the "Main"?
If that is the case then you should have no problem doing something like the following
{
"Type": "Dojo Table Example",
"Main": [{
"Id": 1,
"Description": "Main Table Row",
"Secondary": [{
"Id": "S1",
"Description": "Secondary 1"
}, {
"Id": "S2",
"Description": "Secondary 2"
}
],
"Tertiary": [{
"Id": "T1",
"Description": "Tertiary 1"
}, {
"Id": "T2",
"Description": "Tertiary 2"
}
] }
] }
Unfortunately, your use case is currently not supported.
Due to the nested structure present in the expected input JSON data, there is currently no way of achieving such a scenario as you have.
However, please create a new feature request and the team will look into its feasibility for one of the next releases.
Ok thanks!
Not sure if it is possible, but it could be useful to have the error indicating that multiple FKs have been detected, which is a non-supported case.
Currently, it is not possible as there is no defined structure for multiple FKs and any other structure could represent different things depending on context.
But I will add it as an extra point in the docs page related to Data API limitations (https://docs.dataminer.services/user-guide/Advanced_Modules/Data_Sources/Data_Sources_Limitations.html)
Thx for the quick reply, Joao.
Situation is following:
1. ChargeStations table with ID
2. ChargeCards table with ID
3. ChargeSessions table, which has a FK to a ChargeStation and a FK to a ChargeCard.
I believe your example is 2 table with each 1 FK to a main table. Where as my situation is different, having a table having 2 FK, each to a separate table.