In this tutorial, I'm will show how you can use your own spreadsheet to
export products in JSON format, so that it's easy to import them to Hive Blockchain with Waivio.

Resources:

Set up

1. Create or open table in Google Sheets https://drive.google.com/

2. Click on Extensions tab in top menu

3. Click on Apps Script

https://user-images.githubusercontent.com/67378322/213700307-9a4f3d84-c4d2-4e04-8325-db2460feb1fe.png

4. Add name (for example, Export JSON)

https://user-images.githubusercontent.com/67378322/213700981-76ed4740-73d9-4ffc-a0f8-8c872af707f5.png

5. Delete existing code

https://user-images.githubusercontent.com/67378322/213700694-320d64ed-5152-42be-a13d-cf15a44ce132.png

6. Copy script code from here

7. Insert code in script editor

https://user-images.githubusercontent.com/67378322/213702302-f5c8f640-1149-47bf-b7ee-291514337c8a.png

8. Click on Save project button

https://user-images.githubusercontent.com/67378322/213702387-ed0ae059-6717-46e1-9456-48637dbd8d6e.png

9. Come back to your table and refresh page

10. Now, you should have new tab in top menu.

If the new tab does not appear. Refresh page one more time or you can try to return to the script, add some comment(// comment), save again, return to the table and refresh page. Usually, when the page loads, the new tab appears later.

https://user-images.githubusercontent.com/67378322/213702671-14b60de1-f475-4a56-8b15-5431be5b9f3b.png

Add template to Google Sheets

  1. Open google template with fields and copy to your table.

  2. You need to freeze the first row (View -> Freeze -> 1 row). This is important as this is the name of the fields to be exported.

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213704121-e711629f-0e2f-4308-912f-5390145b68d6.png

Permission

1st time after clicking on "Export JSON for this sheet" you need to give permission to the script.

1. Click Export JSON

2. Click Export JSON for this sheet

https://user-images.githubusercontent.com/67378322/213705238-31509656-8891-43c1-9c8d-185623ca1843.png

3. You will see Authorization Required modal window

4. Click Continue

5. Complete authorization and give permission

6. Click Export JSON one more time

7. You should see notification Running script and modal window with json

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213132930-e4bf4bc1-44fa-4eb1-8e04-02b4f5987fc3.png

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213133031-5172896b-fdae-4754-a368-db8bdf958b32.png

Exported JSON

"Exported JSON" modal window has:

  • direct link to download the file, leads to your google drive;

  • json - that was created by script.

Every time when script is running, file is created on your Google Drive. Even if you edit the same table, every time file will be created. So, don't forget to delete unnecessary files from your Google Drive that were created in this way.

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213723060-33179063-084e-4b90-8c04-3fe04fac3722.png

Table fields

1st line of the table - these are the names of the fields, each next is a separate object:

2nd - object #1

3rd - object #2

4th - object #3

etc.

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213713413-427b73c2-bfdf-43da-8f28-0b13cbdd8ec5.png

Below, table of all fields from the template.

Quick summary: Pay attention to fields:
- categories, imageURLs - because different items should be separated by ";"
- features - format for recording: key: Feature Name; value: Feature description*, key from value must be separated by ";", each feature must be separated by "*"
- waivio_tags - format for recording: key: Tag category; value: Tag*, key from value must be separated by ";", each line must be separated by "*".


Fields

1. asins

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213658601-68c7e464-e25f-47b9-a195-f4a145788273.png

The ASIN (Amazon identifier) used for this product.
Field type: string

2. brand

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213659015-21d6a416-b09a-40a6-9949-9aba7db8e139.png

The brand name of this product.
Field type: string

3. brandLink

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227922684-9526b9c8-153a-4d38-adee-6f5e67297880.png

The permlink to existing business object.
Field type: string
Permlink is a unique object identifier. Can be seen in the link.

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227524389-5bd49279-c2ab-41c6-baf4-608422bf73bc.png

4. categories

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227922955-6d31253c-688b-42fc-a523-c9718697ae6e.png

A list of departments where the product can be found.
Each department must be separated by ";".
There is no need to put a ";" after the last department.
Field type: array

In order to successfully import objects such as a book and a restaurant, the relevant department must be in the list of categories (Books, Restaurant).

5. brand

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/213659015-21d6a416-b09a-40a6-9949-9aba7db8e139.png

The brand name of this product.
Field type: string

6. colors

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227525672-3be985c0-71bc-49a8-acff-a931e2148aea.png

A list of colors available for this product.
That will be options with "Color" category name.
Only one color option can be added.
Field type: array

7. dateAdded

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227923548-9ff51333-da43-492a-bdf4-6aa5a3f85ebd.png

The date this product was first added.
Field type: date

8. dateUpdated

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227923487-e7f88dd7-731c-4d00-9f59-1a87f20fc84a.png

The most recent date this product was updated.
Field type: date

9. descriptions

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227526082-3efa80cf-0920-4eca-a8f3-75b2785d7518.png

The description for this product.
Field type: nested

10. dimension

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227923714-8d5b4d99-1dfd-4079-a01b-683a18215e84.png

The length, width, and height of this product. Units included.
Field type: string

11. dontFetchAmazonOptions

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/228463738-2299318f-c032-441f-9fe1-8ce3b3ac6952.png

If you fill in the value of this field as true, then the options will not be pulled from Amazon but will be taken from the table. In the file it will look like:

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/228465301-75410553-036a-4272-beb3-7d37b89d72e9.png

12. features

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227924696-26d1591e-4597-4e5d-b6db-9c5d74b3f730.png

A list of features associated with this product.
The feature list can be collected from specific feature sections available on product listings for the product. Format for recording features:
key: Feature Name; value: Feature description*

Key from value must be separated by ";".
Each feature must be separated by "*".

Field type: nested

13. groupId

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227526896-4396adab-675f-46de-bbf3-cfcf03f0a907.png

The Group ID used for this product.
Field type: string

14. imageURLs

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925089-c20f57b4-3d59-4db3-9ac6-5468296910d9.png

A list of image URLs for this product.
Each url must be separated by ";".
There is no need to put a ";" after the last url.
Field type: array

15. isbn

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925194-0b96852d-ba97-41a8-9c8e-fb9f8acf928a.png

The ISBN code for this product.
Field type: string

16. manufacture

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925359-ffe9901a-fedb-43d0-9891-9e3f8125dd15.png

The manufacturer of this product.
Field type: string

17. manufacturerLink

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227883969-dd3ae260-b21d-49a9-9634-3a6bd5291b3c.png

The permlink to existing business object.
Field type: string
Permlink is a unique object identifier. Can be seen in the link.

18. merchants

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925448-6ee65f95-5016-4d9b-b111-047a47973c03.png

The merchant name of this product.
Field type: nested

19. merchantLink

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227884606-16efd030-6237-4e0a-9c1d-1ca035b5fa4f.png

The permlink to existing business object.
Field type: string
Permlink is a unique object identifier. Can be seen in the link.

20. mostRecentPriceAmount

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925550-68a85472-35f2-4764-99cd-dd972ee53041.png

The product's most recent price amount scraped.
Field type: float

21. mostRecentPriceCurrency

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925629-e899b137-4533-4f0f-a619-7d6d4b462c45.png

The currency listed for mostRecentPriceAmount.
Field type: string

22. name

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925813-224a03a5-6a66-4dbd-9694-04c7b6a1a9e2.png

The product's name.
Field type: string

23. primaryImageURLs

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925750-49398b44-3afa-441d-b54f-f2ec01fd6daa.png

The product's avatar.
Field type: array

24. sizes

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227885034-dce3afaf-5454-4d08-ba29-f04d3d2879cc.png

A list of sizes available for this product.
That will be option with "Size" category name.
Only one size option can be added.
Field type: array

25. waivio_options

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/235685180-bc067599-0dd9-4fe2-a1b0-e8fbea7cf984.png

A list of options with all fields for options for the product. Format for recording options:
category: Options category; value: Value; position: 1; image: "https://imagelink"*

Every field must be separated by ";".
Each option must be separated by "*".
One option has 4 fields: category and value are required.
Field type: nested

26. waivio_tags

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227885818-ef5e2c8c-7e48-4e09-b33d-11a7bd218357.png

A list of tags with tag categories associated with this product. Format for recording tags:
key: Category Tag Name; value: Tag*

Key from value must be separated by ";".
Each tag must be separated by "*".
Value can have only one option. Therefore, in order to add several tags to one category tag, they need to be recorded separately.
Field type: nested

27. weight

https://images.hive.blog/0x0/https://user-images.githubusercontent.com/67378322/227925967-ba229049-0dba-4f3b-998d-44702298ff25.png

The weight of the product. Units included.
Field type: string

Recommendation

- Use Google account when you don't have important files - because, every time when script is running, a file is created on your Google Drive. So from time to time you will need to clear the space. (Script running after you click "Export JSON for this sheet").

- In order to successfully import objects such as a book and a restaurant, the relevant department must be in the list of categories (Books, Restaurant).

- Do not use ";" as a value in the field, if its categories, colors, features, sizes, waivio_tags because it is a separator for these fields. Use only as separator.

- Do not use "*" as a value in the field, if its features, waivio_tags because it is a separator for these fields. Use only as separator.

- Don't change field names in first row, because there are correct field names.

- Don't change field order and don't delete columns, because the script is guided by the location index.

- It is not necessary to fill in all cells. Empty cells will be skipped.

AI
Waivio AI Assistant
How can I help you today?