Give a default value to a link element in a data schema | Community
Skip to main content
CampaignerForLife
Level 5
June 12, 2024
Solved

Give a default value to a link element in a data schema

  • June 12, 2024
  • 2 replies
  • 737 views

Hello
I've a data schema with something like this
<element externalJoin="true" label="Name" name="Name" target="cd:Name"
type="link"/>

 

How can I make so it has a default value? Right now, it's 0, which is itself a value in cd:name schema

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by vraghav

@campaignerforlife you can setup your schema like this

<attribute default="5" label="ID Name" name="idName" type="long"/> <element externalJoin="true" label="Name" name="Name" target="cd:Name" type="link"> <join xpath-dst="@id" xpath-src="@idName"/> </element>

Above code will set the default value of 5 whenever a new record is created.

 

Kindly change the data type and default value as per your use case

2 replies

Manoj_Kumar
Community Advisor
Community Advisor
June 13, 2024

Hello @campaignerforlife  You can't have a default value for joins

Manoj     Find me on LinkedIn
CampaignerForLife
Level 5
June 13, 2024

But "0" is itself a value by default

vraghav
Adobe Employee
vraghavAdobe EmployeeAccepted solution
Adobe Employee
June 19, 2024

@campaignerforlife you can setup your schema like this

<attribute default="5" label="ID Name" name="idName" type="long"/> <element externalJoin="true" label="Name" name="Name" target="cd:Name" type="link"> <join xpath-dst="@id" xpath-src="@idName"/> </element>

Above code will set the default value of 5 whenever a new record is created.

 

Kindly change the data type and default value as per your use case