Hi,
I am trying to insert data into an attribute that's under a sub element.
Here is the part of the script where I define what to insert:
var event =
<exampleEvent
xtkschema = "exp:exampleEvent"
_operation = "insert"
deliveryTitle = {deliveryTitle}
/>
Here is an example of my data schema:
<element name="exampleEvent">
<element name="subExamples">
<attribute label="Delivery Title" name="deliveryTitle" type="string"/>
</element>
</element>
If I were to take the 'deliveryTitle' attribute out of the subelement 'subExamples', then I am able to see data populate in the 'deliveryTitle' column. However, once I place the 'deliveryTitle' attribute into the sub element, data no longer populates.
Please advise.
Thanks,
Michelle
Solved! Go to Solution.
Hi,
Add data like you have defined your XML:
xtk.session.Write(
<exampleEvent xtkschema = "exp:exampleEvent" _operation = "insert">
< subExamples deliveryTitle = {deliveryTitle}/>
</exampleEvent> );
Thanks.
Hi,
You should define it as:
<exampleEvent
xtkschema = "exp:exampleEvent"
_operation = "insert"
subExamples.deliveryTitle = {deliveryTitle}
/>
Your data will be saved in correct field.
Thanks.
Thanks for the reply. I’ve tried that and it didn’t work for me. The data did not show up in the field.
The data only shows up if I remove <element name=“subExamples”>....</element> from the data schema.
Views
Replies
Total Likes
Hi,
Add data like you have defined your XML:
xtk.session.Write(
<exampleEvent xtkschema = "exp:exampleEvent" _operation = "insert">
< subExamples deliveryTitle = {deliveryTitle}/>
</exampleEvent> );
Thanks.
Views
Likes
Replies
Views
Likes
Replies