Hi Community Team,
Here, I'm using two Cdt's One parent table (Emoloyee Details) and one child table (Comments).
I'm calling primary key in the parent table into the child table to fetch the values in the Child table. I'm getting NULL instead of primary key of parent Cdt. Please help me out how to configure this error?
Child PK Parent FK
Comments_ID Employee_ID
1 NULL
2 NULL
3 NULL
4 NULL
5 NULL
Discussion posts and replies are publicly visible
You can try to save the output from first write to data store entity to a cdt or any process variable of your choice, then in the script task use the cdt in custom outputs, target as path where you want to store the primary key.
One of the possible correct way to get the results to match my scenario. Here we can able to achieve this.. by updating the expression of script task:
repeat(count(pv!childCdt), pv!ParentCdt.PrimaryKey)
Target: childCdt.ForeignKey
Here, it counts the values of childCdt Field like how many inputs passed.. Same Primary key will be generated for the values in single submission. It will be repeat as how many times the childCdt Values passed.
For the reference : Comment Id is the PK of childCdt, Request Id is FK of child Cdt and PK of ParentCdt