Key steps and learning objectives
- Initializing a Domo App
- Configuring the
manifest.jsonfile and publishing Domo Apps (domo publish) - Developing Apps Locally (
domo dev) - Migrating our Domo Brick Code
- Configuring our AppDB collection
- Writing data to AppDB
- Displaying data from AppDB
Initializing a Domo App
You should already have the
Domo Apps CLI and a VS Code editor installed on your machine. To verify that you have it installed, please:
- open VS Code
- open a Terminal window (
Command-Jon Mac) - type the command
domoin the Terminal and press Enter

domo init command. A wizard should walk you through the following steps. Please:
- Give your App Design a unique name - mine is
GameNightPlannerNF - Select the
hello worldstarter template - Don’t connect any datasets for now (type
n)

domo init command has successfully created the initial app files you’ll need.
Next, you’ll want to navigate to the directory where these new app files live. You can navigate to “Open Folder” in VS Code and find the directory where the App was newly created. For me it is the GameNightPlannerNF directory.


index.html: this is the main file in your app - comparable to the HTML file in the Domo Bricks Editor. Notice the starter code in this file includes links to theapp.css,domo.js, andapp.jsfiles.
index.html
domo.js- this is the preloadeddomo.jslibrary, which is analogous to thevar domo = window.domo;global variable found in Domo Bricks. You don’t need to worry about the contents of this file - just know you can use the samedomoglobal variable without pulling it off thewindow.app.css- analogous to the CSS file in bricksapp.js- analogous to the JS file in bricksmanifest.json- the key configuration file that give you control over the “Brick Template” and resources in Domo you want your App to leverage. (More on this in a minute).
manifest.json file that defines all the configuration options for our Domo App.
Configuring the manifest.json file and publishing Domo Apps (domo publish)
Open up the
manifest.json file and have a quick look at what we’re starting with.
name of our App Design (think Brick Template), the version number of our App Design, the default size of cards built from our App Design, and an empty mapping array. This mapping object will let us define which Datasets we want to connect to our app as well as what alias they use.
Let’s leave this blank for now and just publish the very bare-bones version of our Hello World app.
Domo Login
First, make sure you are authenticated against the Domo instance. To do this open up your Terminal in VS Code again and type the commanddomo login
Select new instance and type in the url of the Domo instance you are developing against. In my case, it’s domo-training-apps.domo.com.



Domo Publish
Type the commanddomo publish in your Terminal. You should see an id property get automatically added in your manifest.json file. This id corresponds to the App Design now published in your Domo instance.
thumbnail.png file.

thumbnail.png file to display as an icon for your App. Go ahead and take a moment to pick any image you’d like to use as an icon and drag it into your App directory and name it thumbnail.png. I’ll be using this chatGPT generated image - feel free to use it as well if you’d like.
domo publish command one more time.



Configuring manifest.json to wire up Datasets
Let’s setup our App to connect to our Board Games Dataset by default.
Update your manifest.json so that the mapping list looks like the following.
domo publish again and you should see a big difference on the Wiring Screen of your App. Click “Edit Card” for the “App Instance” (aka card) you created a moment ago.

boardgames and the default Dataset for your card is tied to the Dataset we would expect. You can swap this Dataset out just like you would in a Brick if you want to power this App Instance with different data.

Developing Apps Locally (domo dev)
Now that we have the minimum setup required to recreate our brick, let’s start developing! Back in your Terminal, go ahead and type the
domo dev command. This will launch a hot-reloading local server so you can develop your App locally and only publish to Domo when you’re ready to either overwrite the existing version of an App or publish to a new version.


index.html file with a new title.

Migrating our Domo Brick Code
Our App is still pretty boring. Just a lonely
<h1>. Let’s copy the code that we had in our brick from earlier with only very minor changes.
Our HTML code, can be copied in our index.html file. Your updated index.html file should look like this:
app.css file with the CSS from your brick code.
app.js however a couple minor changes are required.
- You no longer need to load in the
domo.jslibrary since that’s covered by the script tag in theindex.htmlfile. - The
datasetsalias array is now based on what you defined in your manifest. So I’ve setvar datasets = ['boardgames']to match the alias we gave our dataset.

manifest.json file to be 6x6 instead of 1x1.
manifest.json file.
ctrl-Cin your Terminaldomo devagain.

domo publish again — and we’ve successfully converted our brick to an App. Now the fun can begin!
Configuring our new AppDB collection
Configuring a new AppDB collection is just like configuring a Dataset in an App. For our AppDB collection, we just want to be able to track whether the currently signed-in user has marked a given row as “Owned” or not. This will allow our users to track which games they currently own, which will help them plan a successful game night. Can’t plan a game night if you don’t know which games you can play! We’ll define a new
ownership AppDB collection so that each document in the collection has a property for boardGameId and owned.
To do that, we add a collections list to the manifest.json file.
syncEnabled property tells Domo that we want the data in our AppDB collection automatically synced to a new Domo Dataset.
Once you’ve updated your manifest.json file, run the domo publish command again.
Open up your App’s card to see the updated Wiring Screen. Notice a new tab on the left


proxyId to our manifest.json file. This proxyId corresponds to the App Card and can be found by:
-
Go to the “Asset Library” under the “More” menu in Domo.

-
Click on the App Design for your App

-
Navigate to “Cards”

- Copy the “Proxy Id” listed for you card.
-
Add it to your
manifest.jsonfile.
Writing data to AppDB
Remember when we click the editable field in our Tabulator table, nothing persists. We’ll now just need to hook up that click action to write a new document in our AppDB collection if one doesn’t exist for that board game yet, or update a document if one does. To do that, we’ll leverage Tabulator callback functions in conjunction with the AppDB API. In the documentation for Editable Data, Tabulator notes that any time a cell is edited the
cellEdited callback function is called. We’ll want to sync this up with AppDB.
Create new AppDB Document
First lets just get something to print in the console to verify that the callback is triggering as expected. Update the table configuration to add thecellEdited callback function for the own column.
handleCellEdited.
own field now.

boardGameId for the row we clicked on and the value for game ownership.
Next we want to write this data to AppDB.
Update the handleCellEdited callback to create a new AppDB document on edit.
manifest.json file and making a POST request to the ownership collection.
Now try editing a record in your localhost environment. If successful, you’ll see the AppDB document that you just created print to the console.


owner), which we’ll be able to use to personalize our table based on who is looking at it.
Implement Update or Create Logic
While we now have a way to store whether a user owns a particular board game, we still need to handle the case where a document in AppDB for a given user and board game already exist. If it does, we just want to update the record rather than create a new one…otherwise we could end up with a lot of duplicate AppDB documents. Update yourhandleCellEdited callback function to handle this case.
domo publish to push your most recent changes to Domo.
Go ahead and click a few. You can even share your App card with your neighbor to confirm that new documents get created on a per-user basis.
I can see in AppDB Admin, that I’ve successfully tracked ownership for 5 of my favorite games.

Displaying data from AppDB
There’s at least one thing still missing from our App to complete the data collection functionality. We aren’t displaying the stored values in our Tabulator table. To do that, we’ll need to fetch all the AppDB documents for the current user and join them by boardGameId on the client-side before rendering the table. Here’s how we can do that. Let’s refactor our code a bit to be more reusable.
- Create a new function
fetchDatawhere we’ll fetch data from both the Dataset and our AppDB collection. - Before handling results and rendering the table, merge AppDB collection data with Dataset on
boardGameId - Call the
fetchDatafunction when the<body>of our app loads.
app.js file should now look like this:
index.html to update the body tag:
domo publish and we should have a fairly functional app that lets us track which games we own so we can better plan a game night.
Next up: Getting even more advanced. In part 3, we’ll have AI write a game night agenda based on the games we own.