Skip to main content
Sep 1, 2023 4:42 AM UTC
Solved

Facing issue while using xtk.session.Write

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.
Manoj_Kumar
Manoj_KumarAccepted solution
Community Advisor
Sep 1, 2023 6:45 AM UTC

 

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

Manoj  | https://themartech.pro

12 replies

Manoj_Kumar
Community Advisor
Community Advisor
Sep 1, 2023 5:58 AM UTC

Hello @anushkamukherjee 

 

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

 

_key attribute is required for update operations.

Translate
Manoj  | https://themartech.pro
Sep 1, 2023 6:04 AM UTC

 

 

Again error .

Translate
Manoj_Kumar
Community Advisor
Community Advisor
Sep 1, 2023 6:08 AM UTC

Change 

firstName={Anushka}

 

to

 

firstName= "Anushka"

 

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

Translate
Manoj  | https://themartech.pro
LakshmiPravallika
Community Advisor
Community Advisor
Sep 1, 2023 6:26 AM UTC

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.

Translate
Sep 1, 2023 6:37 AM UTC

 

Same error .

 

Translate
ParthaSarathy
Community Advisor
Community Advisor
Sep 1, 2023 9:02 AM UTC

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 + "');");

 

Translate
~  ParthaSarathy S
Sukrity_Wadhwa
Level 4
Sep 27, 2023 6:52 AM UTC

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!

Translate
Sukrity Wadhwa