Expand my Community achievements bar.

SOLVED

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

Avatar

Level 7

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

1 Accepted Solution

Avatar

Correct answer by
Employee

@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.

vraghav_0-1718799004032.png

 

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

View solution in original post

3 Replies

Avatar

Community Advisor

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


     Manoj
     Find me on LinkedIn

Avatar

Correct answer by
Employee

@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.

vraghav_0-1718799004032.png

 

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