Overview of Xero Balances on Accounts

Hi,

I try to get an Overview of all my Bank Accounts out of Xero. Xero give a Structure back with the Information:

but I cannot take it apart to create a Text that I can send via E-Mail. Any ideas what the best approach is?

Frank

Welcome to the Make community!

How do you want to extract the text, and what format do you want to use the text?

E.g.: I would like to extract the values and format them as a comma-separated text string

For further assistance, please also provide the following:

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

Hi,

Attached is tie blueprint.json and Bundles.txt. I modified the Bundles.txt to prevent disclosing confidential Information.

The E-Mail in the End should be human readable, like an easy Table:

Bank name Balance
ANZ Account A 3444.33
ANZ Account B 3333.33
Gem Visa -2323.33
…

Total: 4444.44

My major problem is, how I get access to the Structure. The Sections is an area in my case with 7 elements. Each has 5 Name-Value Pairs. The first one is the Bank Name, the 5th one the Balance.

Frank

blueprint.json (10.9 KB)
Bundles.txt (6.2 KB)

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of three modules:

Screenshot_2024-04-20_190449

Output

Screenshot_2024-04-20_190435

Give it a go and let us know if you have any issues!


Module Export

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block
    Screenshot_2024-01-17_200117

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

JSON

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 18,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": "{{17.sections}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 422,
                            "y": 2,
                            "name": "Iterate Sections"
                        },
                        "restore": {
                            "expect": {
                                "array": {
                                    "mode": "edit"
                                }
                            }
                        },
                        "expect": [
                            {
                                "mode": "edit",
                                "name": "array",
                                "spec": [],
                                "type": "array",
                                "label": "Array"
                            }
                        ]
                    }
                },
                {
                    "id": 21,
                    "module": "util:TextAggregator",
                    "version": 1,
                    "parameters": {
                        "rowSeparator": "",
                        "feeder": 18
                    },
                    "mapper": {
                        "value": "<tr>\n  <td>{{first(map(18.value; \"value\"))}}</td>\n  <td>{{sum(map(slice(18.value; 1); \"value\"))}}</td>\n</tr>"
                    },
                    "metadata": {
                        "designer": {
                            "x": 665,
                            "y": 1,
                            "name": "Aggregate Accounts"
                        },
                        "restore": {
                            "parameters": {
                                "rowSeparator": {
                                    "label": "Empty"
                                }
                            },
                            "extra": {
                                "feeder": {
                                    "label": "Iterator [18]"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "rowSeparator",
                                "type": "select",
                                "label": "Row separator",
                                "validate": {
                                    "enum": [
                                        "\n",
                                        "\t",
                                        "other"
                                    ]
                                }
                            }
                        ],
                        "expect": [
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Text"
                            }
                        ]
                    },
                    "flags": {
                        "stopIfEmpty": true
                    }
                },
                {
                    "id": 16,
                    "module": "email:ActionSendEmail",
                    "version": 7,
                    "parameters": {
                        "account": 94797,
                        "saveAfterSent": false
                    },
                    "mapper": {
                        "to": [
                            ""
                        ],
                        "subject": "Bank Balances (Xero)",
                        "contentType": "html",
                        "attachments": [],
                        "cc": [],
                        "bcc": [],
                        "from": "",
                        "sender": "",
                        "replyTo": "",
                        "inReplyTo": "",
                        "references": [],
                        "priority": "normal",
                        "headers": [],
                        "html": "<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\">\n  <tr><th>Bank name</th><th>Balance</th></tr>\n  {{21.text}}\n</table>"
                    },
                    "metadata": {
                        "designer": {
                            "x": 907,
                            "y": -4,
                            "name": "HTML Email"
                        },
                        "restore": {
                            "parameters": {
                                "account": {
                                    "collapsed": true,
                                    "label": "Google Restricted",
                                    "data": {
                                        "scoped": "true",
                                        "connection": "google-restricted"
                                    }
                                },
                                "saveAfterSent": {
                                    "collapsed": true,
                                    "label": "No"
                                }
                            },
                            "expect": {
                                "to": {
                                    "mode": "chose",
                                    "collapsed": true,
                                    "items": [
                                        null
                                    ]
                                },
                                "contentType": {
                                    "label": "HTML"
                                },
                                "attachments": {
                                    "mode": "chose"
                                },
                                "cc": {
                                    "mode": "chose"
                                },
                                "bcc": {
                                    "mode": "chose"
                                },
                                "references": {
                                    "mode": "chose"
                                },
                                "priority": {
                                    "label": "Normal"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "account",
                                "type": "account:smtp,google-restricted,microsoft-smtp-imap",
                                "label": "Connection",
                                "required": true
                            },
                            {
                                "name": "saveAfterSent",
                                "type": "select",
                                "label": "Save message after sending",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        true,
                                        false
                                    ]
                                }
                            }
                        ],
                        "expect": [
                            {
                                "name": "to",
                                "type": "array",
                                "label": "To",
                                "required": true,
                                "spec": {
                                    "name": "value",
                                    "type": "email",
                                    "label": "Email address",
                                    "required": true
                                }
                            },
                            {
                                "name": "subject",
                                "type": "text",
                                "label": "Subject"
                            },
                            {
                                "name": "contentType",
                                "type": "select",
                                "label": "Content Type",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "html",
                                        "text"
                                    ]
                                }
                            },
                            {
                                "name": "attachments",
                                "type": "array",
                                "label": "Attachments",
                                "spec": [
                                    {
                                        "name": "fileName",
                                        "label": "File name",
                                        "type": "filename",
                                        "required": true,
                                        "semantic": "file:name"
                                    },
                                    {
                                        "name": "data",
                                        "label": "Data",
                                        "type": "buffer",
                                        "required": true,
                                        "semantic": "file:data"
                                    },
                                    {
                                        "name": "cid",
                                        "label": "Content-ID",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "cc",
                                "type": "array",
                                "label": "Copy recipient",
                                "spec": {
                                    "name": "value",
                                    "type": "email",
                                    "label": "Email address"
                                }
                            },
                            {
                                "name": "bcc",
                                "type": "array",
                                "label": "Blind copy recipient",
                                "spec": {
                                    "name": "value",
                                    "type": "email",
                                    "label": "Email address"
                                }
                            },
                            {
                                "name": "from",
                                "type": "text",
                                "label": "From"
                            },
                            {
                                "name": "sender",
                                "type": "text",
                                "label": "Sender"
                            },
                            {
                                "name": "replyTo",
                                "type": "text",
                                "label": "Reply-To"
                            },
                            {
                                "name": "inReplyTo",
                                "type": "text",
                                "label": "In-Reply-To"
                            },
                            {
                                "name": "references",
                                "type": "array",
                                "label": "References",
                                "spec": {
                                    "type": "text",
                                    "label": "Reference",
                                    "required": true,
                                    "name": "value"
                                }
                            },
                            {
                                "name": "priority",
                                "type": "select",
                                "label": "Priority",
                                "validate": {
                                    "enum": [
                                        "high",
                                        "normal",
                                        "low"
                                    ]
                                }
                            },
                            {
                                "name": "headers",
                                "type": "array",
                                "label": "Headers",
                                "spec": [
                                    {
                                        "name": "key",
                                        "label": "Key",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Value",
                                        "type": "text",
                                        "required": true
                                    }
                                ]
                            },
                            {
                                "name": "html",
                                "type": "text",
                                "label": "Content"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

samliew – request private consultation

2 Likes

Many, Many thanks. That works. I would never find this out on my own. :slight_smile:

2 Likes

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future.

samliew – request private consultation

2 Likes