Primary key internal equal to true | Community
Skip to main content
Level 3
June 27, 2025
Solved

Primary key internal equal to true

  • June 27, 2025
  • 1 reply
  • 476 views

Hi @parthasarathy 

Kindly explain the difference when we are using Internal =true while defining the key in schema and what will happen if we are not defining with an eg.

 

1. <key name="deptid"> <keyfield xpath="@deptid"/> </key>

2. <key name="deptid" internal="true"> <keyfield xpath="@deptid"/> </key>

Best answer by ParthaSarathy

@kd1-1 , One observation is, In both cases the deptid will act as a primary key and it won't allow to insert a duplicate deptid record. However, If you define internal="true", then in Schema structure (in client console UI) you can able to see a key icon near to the attribute.

If it is not defined, then you will find a red exclamation mark symbol near to the attribute. This might leads to a confusion for the campaign operator to understand which one is primary key. So, to avoid confusion be consistent in your schema definitions by adding internal="true" in primary key syntax.

1 reply

ParthaSarathy
Community Advisor
Community Advisor
June 27, 2025

Hi @kd1-1 ,

internal="true" is mandatory to define an attribute as a primary key.

internal (boolean): if it is activated, this attribute lets Adobe Campaign know that the key is primary.

Reference document

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
KD1-1Author
Level 3
June 27, 2025

Hi @parthasarathy 

Request you to give an eg explaining using with and without internal=true in a schema

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
June 30, 2025

@kd1-1 , One observation is, In both cases the deptid will act as a primary key and it won't allow to insert a duplicate deptid record. However, If you define internal="true", then in Schema structure (in client console UI) you can able to see a key icon near to the attribute.

If it is not defined, then you will find a red exclamation mark symbol near to the attribute. This might leads to a confusion for the campaign operator to understand which one is primary key. So, to avoid confusion be consistent in your schema definitions by adding internal="true" in primary key syntax.

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups