Adobe Campaign Classic : MEMO field not getting inserted into AC DB when tried with SOAP API queries in workflow javascript. | Community
Skip to main content
April 7, 2020
Solved

Adobe Campaign Classic : MEMO field not getting inserted into AC DB when tried with SOAP API queries in workflow javascript.

  • April 7, 2020
  • 1 reply
  • 6530 views

I have a survey schema that has a bunch of normal attributes and a memo element. When I use xtk.session.Write with an XML object, the string & date attributes update fine in DB, but the memo elements are not getting updated and is blank.
The form field values are stored in local variable and are substituted in the query in javascript. Any idea how to template in an XML element for variable values for memo element in the JS. If i hard code normal text in between xml element of memo fields it is getting stored but not the vars.
Schema elements & attributes :
<attribute desc="Unique Customer ID" label="Customer ID"
length="40" name="cusId" type="string"/>
<attribute desc="Question1" label="Question1" length="40" name="question1"
type="string"/>
<attribute desc="Question2" label="Question2" length="40" name="question2"
type="string"/>
<attribute desc="Question3" label="Question3" length="40" name="question3"
type="string"/>
<attribute desc="Question4" label="Question4" length="40" name="question4"
type="string"/>
<attribute desc="Question5" label="Question5" length="40" name="question5"
type="string"/>
<attribute desc="Question6" label="Question6" length="40" name="question6"
type="string"/>
<attribute desc="Survey Created Date" label="Survey Created Date" name="createdDate"
type="datetime"/>
<element desc="Comment" label="Unsatisfied experience"
name="commentunsatisfaction" type="memo" xml="true"/>
<element desc="Comment" label="Suggestion" name="commentimprovements"
type="memo" xml="true"/>

Query:
var query = <survey _operation='insert' _key='@cusId' cusId={ctx.vars.userId} question1={ctx.vars.question1} question2={ctx.vars.question2} question3={ctx.vars.question3} question4={ctx.vars.question4} question5={ctx.vars.question5} question6={ctx.vars.question6} createdDate={currentDate} xtkschema="cus:survey"><commentunsatisfaction>{ctx.vars.comment1}</commentunsatisfaction><commentimprovements>{ctx.vars.comment2}</commentimprovements></survey>;
xtk.session.Write(query);

 

Please provide your inputs.

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 Jonathon_wodnicki

Hi,

 

Use xtk.persist.Write().

 

Thanks,

-Jon

1 reply

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
April 8, 2020

Hi,

 

Use xtk.persist.Write().

 

Thanks,

-Jon

April 13, 2020

Thanks Jon, When i tried to use the above method i am getting the following error,

XFR-180000 The file '/usr/local/neolane/nl6/datakit/xtk/eng/schema/persist.xml' does not exist on the server. Unable to load the document of identifier 'xtk:persist' and type 'xtk:schema'.
 
I could not find any xtk:persist schema in my ACC instance unlike xtk:session. Is there some additional packages to be deployed for this. 
My console build is 9032
Application server build : 8936.
 
Thanks