Hi @nanenchanga
Just in case it applies to your use case: if you don't need a generic PCF, there is another solution: you just extend the view where the PCF is called. Because in the views you can add columns from a linked table, as long it's a many-to-one relationship.
Now back to the programmatic approach:
You could try first with hardcoded names. Just to get an understanding,
From the screenshots above, I didn't git the name of your main table (the one you apply the PCF on). So from I've got there would be
//<NAME> would be the name of yozr main tabbe
context.parameters.dataset.linking.addLinkedEntity({
name: "<NAME>",
from "<NAME>id",
to: "cr072_sublookup",
linking: "innner",
alias: "ParentRelation"
});
This one adds only the relationship. Then you need to add the column (also in init)
(dataset as any).addColumn("cr072_subname", "ParentRelationship");
So when you get the data, you can access the column
dataset.records[...].getValue("ParentRelationship.cr072_subname")
I have a section about addColumn also in my blog (https://dianabirkelbach.wordpress.com/2022/06/12/pcf-dataset-relationships-linking-in-model-driven-apps/)
Hope it helps!