Skip to content

FAQ: Import Export

klx0 edited this page Mar 5, 2023 · 18 revisions

Can I send the QIF file to Google Docs or Dropbox?

Yes, in the settings, activate Share export file and leave Upload URL empty. After each export, you will see a chooser for selecting an app (like Google Docs or Dropbox) capable of sending the file.

How do I import categories in batch?

My Expenses can import your categories from your Grisbi file (from Settings -> Import -> Import from Grisbi). You can also import the parties (payers and payees) stored in this file. When you choose your custom file as import source, you can decide to import both parties and categories, or only categories. Parties will be used for the autocomplete function of the payer/payee field in the transaction form. If you create an XML file on your own, respect the following structure:

<root>
  <Category Nb="1" Na="Main category A" />
  <Sub_category Nbc="1" Nb="1" Na="Sub category A.1" />
  <Sub_category Nbc="1" Nb="2" Na="Sub category A.2" />
  <Category Nb="2" Na="Main category B" />
  <Sub_category Nbc="2" Nb="1" Na="Sub category B.1" />
  <Sub_category Nbc="2" Nb="2" Na="Sub category B.2" />
  <Party Na="N.N." />
</root>

This method only supports one level of subcategories. Alternatively, create a QIF category file, which allows to import a deeper hierarchy, for example:

!Type:Cat
NMain category A
^
NMain category A:Sub category A.1
^
NMain category A:Sub category A.1:Sub sub category A.1.1
^

Is there a schema for the JSON export?

Contributed by @klx0

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "Schema for My Expenses JSON exports",
    "oneOf": [
        {
            "$ref": "#/$defs/account"
        },
        {
            "type": "array",
            "items": {
                "$ref": "#/$defs/account"
            },
            "minItems": 2
        }
    ],
    "$defs": {
        "account": {
            "type": "object",
            "properties": {
                "currency": {
                    "type": "string"
                },
                "label": {
                    "type": "string"
                },
                "openingBalance": {
                    "type": "number"
                },
                "transactions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/transaction"
                    },
                    "minItems": 1
                },
                "uuid": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "required": [
                "label",
                "openingBalance",
                "transactions",
                "uuid"
            ]
        },
        "transaction": {
            "type": "object",
            "properties": {
                "amount": {
                    "type": "number"
                },
                "category": {
                    "type": "string",
                    "pattern": "^[^:].*[^:]$"
                },
                "comment": {
                    "type": "string"
                },
                "date": {
                    "type": "string"
                },
                "methodLabel": {
                    "type": "string"
                },
                "payee": {
                    "type": "string"
                },
                "pictureFileName": {
                    "type": "string"
                },
                "referenceNumber": {
                    "type": "string"
                },
                "splits": {
                    "type": "array",
                    "items": {
                        "allOf": [
                            {
                                "$ref": "#/$defs/transaction"
                            },
                            {
                                "not": {
                                    "type": "object",
                                    "required": [
                                        "splits"
                                    ]
                                }
                            }
                        ]
                    },
                    "minItems": 1
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "UNRECONCILED",
                        "CLEARED",
                        "RECONCILED",
                        "VOID"
                    ]
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "transferAccount": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string",
                    "oneOf": [
                        {
                            "format": "uuid"
                        },
                        {
                            "maxLength": 0
                        }
                    ]
                }
            },
            "required": [
                "amount",
                "date",
                "uuid"
            ],
            "dependencies": {
                "category": {
                    "not": {
                        "anyOf": [
                            {
                                "required": [
                                    "splits"
                                ]
                            },
                            {
                                "required": [
                                    "transferAccount"
                                ]
                            }
                        ]
                    }
                },
                "splits": {
                    "not": {
                        "anyOf": [
                            {
                                "required": [
                                    "category"
                                ]
                            },
                            {
                                "required": [
                                    "transferAccount"
                                ]
                            }
                        ]
                    }
                },
                "transferAccount": {
                    "not": {
                        "anyOf": [
                            {
                                "required": [
                                    "category"
                                ]
                            },
                            {
                                "required": [
                                    "splits"
                                ]
                            }
                        ]
                    }
                }
            }
        }
    }
}
Clone this wiki locally