1. j2UH8875Wvq4kbFS
  2. RO CSVI
  3. Thursday, 27 July 2017
  4.  Subscribe via email
Hi
I haven't yet used CSVi but I am planning on using it with a new component I am building.

I know that it is possible to use CSVi to take an xml file and import it into a specific database table. My question is; is it possible for CSVi to import the xml file to different tables depending on certain values within the xml file?

For example; if I were to have the following xml file:


<options>
<option>
<type>1</type>
<name>Name 1</name>
</option>
<option>
<type>2</type>
<name>Name 2</name>
</option>
</options>


Would CSVi be able to add the first <option> to a column in table #__com_mycomponent_table1 and the second <option> to a column in #__com_mycomponent_table2 based on the value of the <type> element?

Thank you
Accepted Answer Pending Moderation
Hello,
You cannot import the XML you have posted by having one CSVI import template but you can create two custom table import templates and set your component tables accordingly in each template. You then need to create template fields so that XML nodes are read accordingly in each template. This exact scenario is explained in import XML with same node names document. Please follow how the <child> nodes are imported using two different templates and how to ignore the unwanted nodes using Skip field. You need to do the same for your XML too.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!