Jae Wilson @DataCrew
webinar

[Webinar Recording] - On DDX Bricks with Noah Finberg & Elliott Leonard

November 2, 2022

🎉Thank you to everyone who attended.  This webinar was hosted on 11/2/2022 by the DataCrew team in an effort to bring more DDX Bricks awareness to the Domo Community.

Special thanks to  and  for their participation!  🎉

Original Event Link - https://datacrew.circle.so/c/events-170e7d/ddx-bricks-ama



Important Links

Q&A and Resources

Reading Datasets into DDX Bricks

🎥 Webinar Link Demo 2

Use Domo.get to retrieve data from the APIs

https://developer.domo.com/docs/dev-studio-guides/domo-js#domo.get

This method works, but the SQL API might be easier to interpret/use

💎PRO TIP.  Take the time to learn and understand “Promises”



This snippet says “wait till you get a response from your 4 APIs THEN … do something.

Imagine you have a brick that consumes data extracted from 4 APIs.  When you send your domo.get() request, you don’t know how long it’ll take your API to return a result.

Each .get() method returns a promise that eventually you’ll get something back, but instead of blocking code execution (synchronous execution), JavaScript allows us to move to the next line of code and come back to the promise when it has a result (asynchronous code execution).

💎  Where have you seen asynchronous code execution?

Have you ever visited a graphics heavy website with slow internet connection and seen a spinning loading icon while parts of the page finished loading?  Classic example of asynchronous code execution!

Alternatively, have you ever scrolled facebook and all the text loaded faster than the images?  Another example of a page requiring two different APIs AND asynchronous code execution.

https://www.w3schools.com/js/js_promise.asp

💎The SQL API is even easier than Domo.get

https://developer.domo.com/docs/dataset-api-reference/dataset#Query%20a%20DataSet

When it comes to code you can execute in DDX bricks, it looks like you can only hit “public APIs” i.e. APIs documented under www.developer.domo.com

On Private Vs. Public APIs

  • Get Outa the Domo UI - Domo IDEAS Exchange Conference Video YouTube video

Are there limitations in the SQL API with queries?

Balance what you execute as a query in the app vs. what you implement in ETL or a Dataset View.  The simpler the query, the faster the query response, and the snappier the app.

Theoretically, the SQL API is passing the same queries to the same database engine that resolves Dataset Views, so yes, theoretically subqueries should be supported in the SQL API… should you do it? … different question.

How to have more than one dataset in DDX bricks?

Use the DDX 10 Datasets Brick (domo-dojo link)

Pulling Parameters from the Environment

🎥 Webinar Link Demo 1

https://developer.domo.com/docs/dev-studio-guides/domo-js#domo.env

Use a DDX Brick to apply a Page Filter

🎥 Webinar Link Demo 5

https://developer.domo.com/docs/dev-studio-guides/domo-js#domo.filterContainer

Making your App react with Event Listeners and OnClick events

🎥 Webinar Link - Demo 6

https://www.freecodecamp.org/news/html-button-onclick-javascript-click-event-tutorial/

https://www.w3schools.com/howto/howto_js_trigger_button_enter.asp

Using Phoenix Library

🎥 Webinar Link - Demo 4

https://github.com/DomoApps/domo-phoenix

https://domoapps.github.io/domo-phoenix/#/domo-phoenix/properties

The Phoenix library was implemented to provide a JavaScript charting library that looked and felt like Analyzer.

Getting Started with State Management + AppDB

🎥 Webinar Link - Demo 6

https://developer.domo.com/docs/dev-studio-references/appdb

AppDb can be used to store form data or user interactions (aka “state management”)

💎 Where have you seen state management?

Any time you log into an app and it ‘remembers’ who you are or what was in your shopping cart.

https://dev.to/abdurrkhalid333/what-is-state-management-and-why-you-should-learn-it-3kai

Additional Infrastructure and Development Skill

🎥 Webinar Link - Noah's Intro

🎥 Webinar Link - the Value of an "App Platform"

What do they mean, by “Domo makes it easier to build and deploy an app?”

https://developer.domo.com/docs/dev-studio/dev-studio-overview

💎Development Pro Practices

Use CodePen as a faster IDE (development environment)

🎥 Webinar Link - Tip 3 - use CodePen

www.codepen.io

CodePen has great (simple) code samples built by the larger javascript community.  Integrate the examples into your DDX Bricks.

To mimic the handleResults() function in CodePen (which is NOT hooked up to the Domo API): console_log(data) and then copy/paste the results into your CodePen Javascript file as a new variable, data.  This allows you to develop code in CodePen after the point data was retrieved dynamically from the Domo’s Dataset API.

Inspect your Browser to see how your HTML document is shaped.

🎥 Webinar Link - Demo 1

🎥 Webinar Link - Tip 4 - using the Browser to inspect the DOM (rendered HTML document)

This can help you troubleshoot and debug how your app displays data in the browser.

Pro Tip.  Take the time to learn about DOM manipulation. (i.e. “Dynamically adding content to your webpage”)

https://fundamentals.generalassemb.ly/11_unit/dom-cheatsheet.html

If you want your app to be pretty, but spend less time “reinventing the wheel” learn about Bootstrap (https://getbootstrap.com/)

If you’ve heard of React (https://reactjs.org/) this library is designed to simplify DOM manipulation.

If you’re competent in React, consider learning about MUI (previously MaterialUI, https://mui.com/ )

Consider using Save As Copy for Version Control

DDX Bricks don’t really integrate with any of Domo’s built in Version Control (or at least not in a way we can quickly access.

If you are making major revisions to your App, consider Saving your app as a copy.  Just like you can save your cards and change the columns, or filters, you can save a copy of your card and modify the code.

Alternatively, as you start building more sophisticated projects, consider saving your documents in folders backed up using GitHub.

Other Questions

If the DDX brick is published to another instance, will it know to use the respective dataset within that subscriber not the publisher?

Apps can be deployed with sample datasets (like all the apps you’re deploying) there is no built-in wiring that integrates with publish.  That’s relatively niche.  You could write a script that handles wiring up the datasets (like the Quickstarts do).  Keep in mind that an app deployed to a different instance will ultimately consume a dataset with a different dataset_id so it’s hard to “just know” what the correct dataset is.

is it always necessary to have a dataset even if it's not used?

Each DDX Brick that YOU build is based on a baseline template (the app in the AppStore).  Those Templates have a fixed number of datasets available (in the blank app it has 3, in the 10 Dataset brick its 10)  Do you HAVE to use them? No.  But is there a max you can / could use?  Yes, as defined by the template.

For Maps: Is it possible to go as granular a map based on postal codes for Germany?

Are you talking about the standard apps in Analyzer?  It depends on what THAT chart type is capable of.

If you’re talking about a custom app built using SVGs that’s a different tool.  If you used a custom map, could you use a map that was divided by German postal codes?  Sure, if you can find that SVG.

https://www.youtube.com/watch?v=eKOLhsfl10Q

If you want to use ArcGIS (https://developers.arcgis.com/javascript/latest/) or any other library, the answer is defined by the library you choose.

Other Bricks of Interest

Filtering on multiple Columns (Ben Schein)

https://www.domo.com/appstore/app/ddx-searchable-filter-app-multiple-columns/overview

Example of Where used (this was initially a custom app and the code was migrated to a flexible DDX Brick for you! YAYYYY)

https://www.domo.com/covid19/data-explorer/all/

Related

More posts on similar topics.

Got a project in mind?

hire me →

Getting value from the content but not ready to hire?

let's call it professional development

☕ buy me a coffee →

Want a practitioner take on Domo and AI, every month?

free, no spam, unsubscribe anytime

📰 subscribe to the digest →