How to create an import set table using a JSON file

KS18
Giga Guru

When importing, JSON files can be used, but when selecting files with loaddata,
JSON files cannot be selected.
How should I create the importset table?

1 ACCEPTED SOLUTION

Hi,

You can do that and build out the import set table using it via file (and then attachment as the "File retrieval method").

So example of a JSON file could be:

{
"user": {
    "firstName": "Rack",
    "lastName": "jackson",
    "gender": "man",
    "age": 24
}
}

Data source settings would look like:

find_real_file.png

Then you can test load records, in which the import table and fields are made and the import set looks like:

find_real_file.png

The above is all an example, please use what I've given and take it from there.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

7 REPLIES 7

Allen Andreas
Administrator
Administrator

Hello,

Please see the documentation and guidance as mentioned here: https://developer.servicenow.com/blog.do?p=/post/importing-and-exporting-json-in-jakarta/

And the section: IMPORTING JSON / JSON DATA DATA SOURCES

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you for your comment.
I want to create an importset table by first attaching a JSON file directly to the datasource at first, then set it to fetch the JSON file placed in a specific location. This is because I haven't decided on the location yet, but I want to prepare for import set table first.
Is this the right thing to do?

Hi,

You can do that and build out the import set table using it via file (and then attachment as the "File retrieval method").

So example of a JSON file could be:

{
"user": {
    "firstName": "Rack",
    "lastName": "jackson",
    "gender": "man",
    "age": 24
}
}

Data source settings would look like:

find_real_file.png

Then you can test load records, in which the import table and fields are made and the import set looks like:

find_real_file.png

The above is all an example, please use what I've given and take it from there.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you, I understand.
I am planning to create two Datasources.
The first one is a DataSource with attachments configured,
The second is a DataSource with the deployment location.
The first Datasource will be used only once.
Should I delete it after use, or keep it?