Skip to content

A Peek Under CloudSimple’s Hood

We talk about SAP a lot on this blog. Blathering on about Fiori and HANA and Gateway doesn’t feel like blathering to us…we actually geek out about this stuff and love to share our passions. It’s our primary area of technical expertise. I mean, it would frankly be alarming if we didn’t talk about SAP so much.

When we started brainstorming what would eventually become CloudSimple, we realized that we had a pretty significant learning journey ahead. Gluing two platforms together means knowing a lot about both platforms. We came to the table knowing a lot about the SAP side of the equation, and much much less about the Google side. Added bonus: as we searched around we realized that there was not a lot of existing material out there on the web for us to learn from.  We’d have to learn by inventing.

In this entry, I’ll take you on a high-level look at the Google Apps Script add-on pieces of the CloudSimple architecture. Coming soon: an entry for the SAP pieces.

CloudSimple is built on the Google Apps Script add-ons platform. It runs user interface code in standard HTML/CSS/Javascript, includes server-side processing in Apps Script (a flavor of Javascript), and in the next release incorporates Google App Engine for processing user settings stored in Google Cloud SQL. (I’ll write more about App Engine and Cloud SQL in a later entry).

User Interface

There are two key pieces where users interact with CloudSimple:

  • The settings dialog where they choose a connection and data source.
    • HTML is served with HtmlService, which works in conjunction with the SpreadsheetApp class to present a UI inside the spreadsheet itself. In this case, showModalDialog() is the method of choice.
    • The HTML file is created and stored in the Apps Script web IDE. I was actually shocked when I started using the Apps Script IDE – it includes a full debugger! That lives on the web! Pretty slick.
    • Until recently, markup and scripts that were sent to HtmlService were sanitized and compiled by Caja, which meant that some features/libraries of javascript would not work. Google has since relaxed that constraint.
  • The right-anchored sidebar where users input filters, choose fields, and execute read/updates
    • Same idea as the settings dialog for HTML, except it is presented with the showSidebar() method.
    • Note that the sidebar is confined – you always get the same width to place your items. You’d think this would be rather restricting, but for us it was a good example of how obstacles prompt creativity.

Back End

Application logic and connectivity to other things (including, most importantly, to SAP Gateway systems) is accomplished through Apps Script’s server-side flavor of javascript. CloudSimple deals with this mostly in creating formatted requests to an SAP Gateway system, then taking the results of those requests and making them accessible to users in the spreadsheet.
Some things we had to learn:
  • The cool thing with Apps Script is that you have access to tons of APIs that Google provides into their other systems. I can make calls to fetch web data, mess around with spreadsheets, data ranges, send emails, create other Google documents, and much much more.
    • (Aside) I think that this more or less reflects the modern programmer’s challenge: glue together lots of APIs into a coherent thing – which may then even become an API for something else.
  • Storing non-relational data (like user settings for an individual spreadsheet) can be accomplished with the Properties service. In CloudSimple, I put together a cool mashup of the long-term Properties service and the transient (but fast) Cache service to speed up a few things in the user experience.
  • If you’ve programmed in VBA for Microsoft Excel, you know that almost any programmatic changes you make to a spreadsheet appear basically instantaneously in the user interface. Not so with Apps Script. You have to remember that the code you write executes on Google’s servers and then the changes to the spreadsheet are propagated to the user’s view of the spreadsheet in their browser window. Similarly, any changes made in the user’s view of the spreadsheet may experience a brief delay before Google’s internal representation of the spreadsheet reflects those changes.

Putting It All Together

Apps Script does a good job of giving you an environment where you can see all of what you’re building in one place. You can split up your application logic into separate files to keep yourself from managing one monolithic 10,000-line beast of an include. You can write a tiny little function to test something and step through it in the debugger.
For CloudSimple, iteration was the most important part of being able to put it all together quickly. We went through several redesigns of the user interface and lots of tweaks to application logic. Apps Script gave us the ability to prototype something quickly, tear it down, and build something else from the parts. Fast.
Coming soon: a look at the SAP Gateway side of the equation. How does CloudSimple know what it does about backend services? What are some things that can be done in custom SAP services to make better use of CloudSimple?
If you have an interest in viewing similar content, visit our blog, here

View our LinkedIn, here

Paul Modderman loves creating things and sharing them. He has spoken at SAP TechEd, multiple ASUG regional events, ASUG Fall Focus, Google DevFest MN, Google ISV Days, and several webinars and SAP community gatherings. Paul's writing has been featured in SAP Professional Journal, on the SAPinsider blog, and the popular Mindset blog. He believes clear communication is just as important as code, but also has serious developer chops. His tech career has spanned web applications with technologies like .NET, Java, Python, and React to SAP soutions in ABAP, OData and SAPUI5. His work integrating Google, Fiori, and Android was featured at SAP SAPPHIRE. Paul was principal technical architect on Mindset's certified solutions CloudSimple and Analytics for BW. He's an SAP Developer Hero, honored in 2017. Paul is the author of two books: Mindset Perspectives: SAP Development Tips, Tricks, and Projects, and SAPUI5 and SAP Fiori: The Psychology of UX Design. His passion for innovative application architecture and tech evangelism shines through in everything he does.

Back To Top