Custom field data using import

Dear All,
According to our school’s requirement, I added to custom fields (Caste and Category) for students roles in gibbon as shown below

Now I need to import students’ caste and category using “Import from file” thru excel.
But I don’t understand how to do it using excel using the sample excel sheet given below

Please help
Rajendran

Hi Rajendran,

Custom fields can be imported, but because each school has different fields, you’ll need to modify the import definition so that it matches your field names. Here’s a link with some instructions that may help: https://ask.gibbonedu.org/discussion/comment/3920/#Comment_3920 (it is for Data Admin, but that same functionality is now in System Admin > Import from File)

The example file can be found in resources/imports/usersCustomData.yml

As a note, when importing the data, for the final column called Custom Fields select [Custom] and just leave it blank.

I have copied the file customFieldsExample.yml into /uploads/imports folder.
But from where I can see the following screen?

Pls. help

It should show up at the top of your System Admin > Import from File page, as a custom import. Otherwise, you could try directly editing the file in resources/imports/usersCustomData.yml and it shows up in the User Admin section at the bottom of the page.

Dear Sandra,

According to your advice, I have edited resources/imports/usersCustomData.yml. And as you can see in the screenshot, the import is working now without any errors. But still data is not updated in the database.

this is my usersCustomData.yml file
details:
type: usersCustomData
name: Custom Fields - Data
desc: Data for custom fields (Included as an example)
category: Custom Fields
table: gibbonPerson
modes: { update: true, insert: false }
access:
module: User Admin
action: Manage Users
primaryKey:
gibbonPersonID
uniqueKeys:
- gibbonPersonID
table:
gibbonPersonID:
name: “Person”
desc: “Username”
args: { filter: nospaces, required: true }
relationship: { table: gibbonPerson, key: gibbonPersonID, field: username }
caste:
name: “Caste”
desc: “Caste”
args: { filter: string, readonly: true, required: true, serialize: fields }
category:
name: “Category”
desc: “Category”
args: { filter: string, readonly: true, required: true, serialize: fields }
fields:
name: “Custom Fields”
desc: “”
args: { filter: customfield, serialize: fields, custom: true }
~

Dear Sandra,
I have solved this issue by replacing ‘fields’ in ‘gibbonPerson’ with ‘{}’ before doing import

Thank You

Aha, this may help me replicate the issue. I wonder if it’s related to empty strings not properly decoding as json arrays. I’ll check this out, and I appreciate you sharing your solution so that we can ideally fix this.

Set all “Custom Fields” with “{}” in importing excel file will also solve this issue

Thank you

Can you help with the same problem we are facing since last 1 week.
Thanks in Advance .

Regards
Om Verma

Hi Rthunoli,
we are having similar problem unable to resolve it, we put {} in the custom field column in excel sheet, yet no success, attaching error screenshot, kindly help.

Thanks in advance.
Om Verma

Hi @opverma1 Please see the reply here: V25, Error importing Data in Custom Fields - #2 by sandra

Thanks!