Facing issue while using xtk.session.Write | Community
Skip to main content
September 1, 2023
Solved

Facing issue while using xtk.session.Write

  • September 1, 2023
  • 4 replies
  • 3319 views

Hi All, I am currently working in Adobe V8. I have created a schema using autopk and also gave there a pk sequence. But when I am trying to insert data into that schema using xtk.session.Write unable to find key values of elements .  I am attaching code and error syntax .

 

 

 

 

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 Manoj_Kumar

 

here are the structures.


Hello @anushkamukherjee 

 

It looks like you are on FFDA mode of v8.

 

Use xtk:session.Ingest method to insert data.

 

Reference link: New Campaign v8 APIs | Adobe Campaign

4 replies

Manoj_Kumar
Community Advisor
Community Advisor
September 1, 2023

Hello @anushkamukherjee 

 

Remove the _key="@id" from the code and try again.

 

_key attribute is required for update operations.

Manoj  | https://themartech.pro
September 1, 2023

 

 

Again error .

Manoj_Kumar
Community Advisor
Community Advisor
September 1, 2023

Change 

firstName={Anushka}

 

to

 

firstName= "Anushka"

 

{} is for variable and "" is used for strings

Manoj  | https://themartech.pro
LakshmiPravallika
Community Advisor
Community Advisor
September 1, 2023

Hi @anushkamukherjee ,

 

Please try giving this way

 

xtk.session.Write(<customer _operation="insert" leadId="102" xtkschema='eps:customer' /> );

 

Please try with both leadId=102 once and leadId="102" with the above syntax and let me know.

 

Also try giving xtkschema Syntax at the end.

 

Regards,

Pravallika.

September 1, 2023

 

Same error .

 

ParthaSarathy
Community Advisor
Community Advisor
September 1, 2023

Hi @anushkamukherjee ,

Try below Script,

vars.leadId = 1234; xtk.session.Write(<customer _operation="insert" leadId={vars.leadId} xtkschema='eps:customer'/> );

With the above Script am able to insert a record in schema with leadId as 1234.

 

And in your console version, if you still face error for xtk.session.Write, alternatively you can try below script,

vars.leadId = 1234; sqlExec("insert into EpsCustomer (iLeadId) values ('"+ vars.leadId + "');");

 

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

Hi @anushkamukherjee,

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!

Sukrity Wadhwa