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

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

  • April 7, 2020
  • 1 reactie
  • 6530 Bekeken

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.

Er kunnen geen reacties meer worden geplaatst op dit onderwerp.
Beste antwoord door Jonathon_wodnicki

Hi,

 

Use xtk.persist.Write().

 

Thanks,

-Jon

1 reactie

Jonathon_wodnicki
Community Advisor
Community Advisor
April 8, 2020

Hi,

 

Use xtk.persist.Write().

 

Thanks,

-Jon

Darren_Bowers
Level 9
April 9, 2020
Whats the difference between the two Write methods? Why does xtk.session.Write() fail when xtk.persist.Write() work?