I have two protocols, each with its own table. The table of protocol A has a column with foreign keys to the table of protocol B. I want to create a view table with all rows of the A-table and with additional columns from the B-table.
I'm been following this guide but I can't really figure out how to solve this scenario. It seems like a I need a combinations of the guide's two different scenarios because it's two different protocols.
I've tried created a Direct view table, basically mirroring the table from protocol B and the creating a normal view table, viewing the table from A and adding a foreign key to the direct view table. However the added column is empty.
Table A-1
<ArrayOptions index="0" options=";naming=/503">
<ColumnOption idx="0" pid="501" type="retrieved" options="" />
<ColumnOption idx="1" pid="502" type="retrieved" options="" />
<ColumnOption idx="2" pid="503" type="retrieved" options="" />
<ColumnOption idx="3" pid="504" type="retrieved" options="" />
<ColumnOption idx="4" pid="505" type="retrieved" options="" />
<ColumnOption idx="5" pid="506" type="retrieved" options="" />
<ColumnOption idx="6" pid="507" type="retrieved" options="" />
<ColumnOption idx="7" pid="508" type="retrieved" options="" />
<ColumnOption idx="8" pid="509" type="retrieved" options="" />
<ColumnOption idx="9" pid="510" type="retrieved" options=";foreignKey=9000" />
</ArrayOptions>
Table A-2 (Direct view of Table B)
<ArrayOptions index="0" options=";volatile;view=900,remoteId;directView=702">
<ColumnOption idx="0" pid="9001" type="custom" value="" options=";view=901" />
<ColumnOption idx="1" pid="9002" type="custom" value="" options=";view=902" />
<ColumnOption idx="2" pid="9003" type="custom" value="" options=";view=903" />
</ArrayOptions>
Table A-3 (View table of A-1 + A-2), here the last column is just populated with "Not initialized"
<ArrayOptions index="0" options=";volatile;view=500">
<ColumnOption idx="0" pid="1301" type="custom" value="" options=";view=501" />
<ColumnOption idx="1" pid="1302" type="custom" value="" options=";view=502" />
<ColumnOption idx="2" pid="1303" type="custom" value="" options=";view=503" />
<ColumnOption idx="3" pid="1310" type="custom" value="" options=";view=510:9002" />
</ArrayOptions>
Hi Robin,
I do not believe this is possible, when joining two tables from different sources into a view table, the primary keys of both tables have to be identical, this is what allows the view table to identify the correct row to place the data.
Side Note: view tables are no longer the recommended way to filter data, GQI is the recommended way moving forward.
Hopefully, this helps even though it is not a direct solution
Hi Robin, Yes GQI is only available in the dashboard module. If the merged table is needed at the protocol level, you will have to take the other approach of adapting your tables to have the same primary keys.
Hi Aldrick. How do I use GQI in a protocol? I thought it was only used in Dashboards.