How to set N - 1 (recipient) correctly? | Community
Skip to main content
Level 6
November 11, 2024
Solved

How to set N - 1 (recipient) correctly?

  • November 11, 2024
  • 3 replies
  • 1008 views

I've a schema abc:multipleops (that stores all operations - transactions - related to a recipient) that I need to stablish a N-1 relationship with Recipients. The relationship should be visible from both sides.


documentation says, I just should not type: revCardinality

  • revCardinality (optional): with value “single” populates cardinality with type 1-1 (1-N by default)


So, this is what I need to enter to abc:multipleops, so multiple operations are linked to a single recipient???

I'm crossing revCardinality="single"   meaning that I'll remove this part from the code below:


<element integrity="normal" label="Recipient" name="recipient" noDbIndex="true"
revCardinality="single" revLabel="multipleops (Link)" revLink="multipleops"
revTarget="@codinterno" target="nms:recipient" type="link">
<join xpath-dst="@codinterno" xpath-src="@codinterno"/>
</element>

How can I validate it from the interface?

Best answer by god_prophet

In recipients you don't need to add anything when doing a N-1 to recipients.

Only in the table you want to modify.

Insert after last attribute: 

<element integrity="normal" label="Recipient" name="recipient" noDbIndex="true" revIntegrity="normal" revLabel="multipleops (Link)" revLink="multipleops" target="nms:recipient" type="link"> <join xpath-dst="@codinterno" xpath-src="@CODINTERNO"/> </element>

 

 

On the other hand, when it is a 1-1 Relationshipd, you need to modify both tables:

On abc:mytable

<element integrity="normal" label="Recipient" name="recipient" noDbIndex="true" revCardinality="single" revIntegrity="normal" revLabel="mytable (Link)" revLink="mytable" target="nms:recipient" type="link"> <join xpath-dst="@codinterno" xpath-src="@CODINTERNO"/> </element>




on Recipients:

<element externalJoin="true" integrity="normal" label="mytable (Link)" name="mytable" noDbIndex="true" revCardinality="single" revIntegrity="normal" revLink="recipient" target="abc:mytable" type="link"> <join xpath-dst="@CODINTERNO" xpath-src="@codinterno"/> </element>



 

3 replies

ParthaSarathy
Community Advisor
Community Advisor
November 11, 2024

Hi @god_prophet ,

In abc:multipleop schema, write the below script:

<element integrity="normal" label="Recipient" name="recipient" noDbIndex="true" revLabel="multipleops (Link)" revLink="multipleops" revTarget="@codinterno" target="nms:recipient" type="link"> <join xpath-dst="@codinterno" xpath-src="@codinterno"/> </element>

Disconnect and reconnect the console.

Open abc:multipleop schemam> structure tab, you can see it is 1 to 1 link with Recipient table and Open Recipient schema > structure tab > display advanced field > you can see 1 to Many link (Orange color icon) created between recipient to multipleop

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
Sukrity_Wadhwa
Community Manager
Community Manager
November 12, 2024

Hi @god_prophet

I see that you have another thread with the same content, where a solution has been provided. Can we close this thread based on the solution shared there: https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/how-to-set-a-1-to-1-relationship-correctly/td-p/717019?

Let us know. Thanks!

 

 

Sukrity Wadhwa
Level 6
November 12, 2024

Hi, those are differente... that one was about 1-1 relationship... this one is a 1-N relationship

Sukrity_Wadhwa
Community Manager
Community Manager
November 13, 2024

Oh yeah, sorry my bad. Thanks for clarifying though!

Sukrity Wadhwa
god_prophetAuthorAccepted solution
Level 6
June 13, 2025

In recipients you don't need to add anything when doing a N-1 to recipients.

Only in the table you want to modify.

Insert after last attribute: 

<element integrity="normal" label="Recipient" name="recipient" noDbIndex="true" revIntegrity="normal" revLabel="multipleops (Link)" revLink="multipleops" target="nms:recipient" type="link"> <join xpath-dst="@codinterno" xpath-src="@CODINTERNO"/> </element>

 

 

On the other hand, when it is a 1-1 Relationshipd, you need to modify both tables:

On abc:mytable

<element integrity="normal" label="Recipient" name="recipient" noDbIndex="true" revCardinality="single" revIntegrity="normal" revLabel="mytable (Link)" revLink="mytable" target="nms:recipient" type="link"> <join xpath-dst="@codinterno" xpath-src="@CODINTERNO"/> </element>




on Recipients:

<element externalJoin="true" integrity="normal" label="mytable (Link)" name="mytable" noDbIndex="true" revCardinality="single" revIntegrity="normal" revLink="recipient" target="abc:mytable" type="link"> <join xpath-dst="@CODINTERNO" xpath-src="@codinterno"/> </element>