List Manager Forum

Import data from CSV / Users & Option field

User travelsupport 2016-01-11 22:30:05

Hello,

I want my users to be allowed to put into the form only 2 fields (some external order number and choose one option field). On the basis on this input I need to update the list. If I download xls/csv file there is a User name, and name of the value of the option field. But to import data correctly I need the user id and the value of the option field.
So, as it looks for me...List Manager exports the csv/xls files with the name of the values but to import data from the backends it needs the file with the values. I don't see any sense or I missed something.

And one more thing....Is it also possible to update/overwrite data while importing? As I see there is totally new entry being created so I need to delete all the entries and import updated again? I see there was a suggestion in APR'14 (http://bit.ly/1UK0tkf) of such feature but I cannot find if it's implemented already.

Regards,

Moonsoft support 2016-01-12 19:52:39

Hello,
yes, you're right. Some versions ago, this function was working as you explain (it exported values, so you could use that same csv for importing again). A big number of users didn't want to work that way, they use the csv to create reports or to share the list, so they always want to see the names. So this function was changed accordingly. In order to export a list and then import it again (for ex for moving to another site), the option 'export' is the one to be used. It exports in xml format both the list structure and the data (this time, with the values), so it can be imported afterwards.

The add data with csv is intended to load new values at the list, is not a manager for updates. These options (load from csv,sql..) are used to make a first bulk upload of data. If you have at your csv the whole list again with all your values, and you want to 'reload' you have the option to 'empty list' before the new upload in order to avoid duplicates.

Regards

User travelsupport 2016-01-12 21:03:56

Hi,

can you please advise which file and how to edit it to export data in the backend with the values not the records name? I would be very grateful.

Regards

Moonsoft support 2016-01-13 11:39:02

Hi,

You should go to JOOMLA/administrator/components/com_listmanager/models/listing.php and search for 'getDataRecordsUnlimited' function and replace:

function getDataRecordsUnlimited() {
return $this->getDataRecordsWrapper(false,true);
}

with:

function getDataRecordsUnlimited() {
return $this->getDataRecordsWrapper(false,false);
}

If this doesn't work, please place a ticket at helpdesk and we'll take a look.

Regards,

User travelsupport 2016-01-14 17:19:21

Hi,

for the field of user it works correctly.
But the problem is with the option fields. It exports numeric value of each option but while import it does not read the value of chosen option.

Regards

Moonsoft support 2016-01-15 10:09:56

Hi,
the option fields have an internal id. At the export function
getDataRecordsWrapper
you must also change this internal id for the real 'value' of each option. You would need to query database to get this value, the table where option values are stored is listmanager_field_multivalue. You can ask for a custom version if you're not sure how to code this change.


Regards

...
List Manager

Build different lists for your site

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!