Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards
SOLVED

fetching data from the linked table using query def in web application

Avatar

Level 2
Level 2

Hi Team,

I'm trying to fetch the super team field data in relationship manager table and which is linked from recipient to relation ship manager as 1 to 1 cardinality.

I'm using below code to fetch them 
----------------------------------------------------------

var recipientquery = xtk.queryDef.create(<queryDef schema="nms:recipient" operation="select" >
<select>
<node expr="@id"/>
<node expr="[relationshipManager/@superTeam]" alias="@superTeamDec"/>
<node expr="Smart(Lower(@firstName)) + ' ' + Smart(Lower(@lastName))" alias="@fullName"/>
</select>


</queryDef> );
var recipientData = recipientquery.ExecuteQuery();

------------------------------------------------------------

But I'm getting below errors [Highlighted in red]

 
Element 'relationshipManager' unknown (see definition of schema 'Recipients (nms:recipient)'). XTK-170036 Unable to parse expression '[relationshipManager/@superTeam]'. SOP-330011 Error while executing the method 'ExecuteQuery' of service 'xtk:queryDef'.

Note: Here the table name and field name configured correctly as per the instance but still facing issue.

Could you please help to fetch the data.
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @VV7,

 

Great, by the image you are sharing the element name is lnkRelationshipManager, not relationshipManager. You should use the same name in your code. 

 

Let me know if it solves the error. 

 

Best, 

Celia

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @VV7,

 

Based on your error you will need to define relationshipManager on your recipient schema, it seems that the link is not defined, which is why it fails. 

 

Once you confirm that the link is defined on you JS you should add a join. 

 

Let me know if you need more help!

 

Best, 

Celia

Avatar

Level 2
Level 2

Hi @ccg1706 

FYI:

The link is configured in the recipient schema.

But why its not bale to get the data

VV7_0-1752576112250.png

 

Avatar

Correct answer by
Community Advisor

Hi @VV7,

 

Great, by the image you are sharing the element name is lnkRelationshipManager, not relationshipManager. You should use the same name in your code. 

 

Let me know if it solves the error. 

 

Best, 

Celia

Avatar

Level 2
Level 2

Hey Celia,

You Gotcha!

 

It's working Thankyou so much!