AppMachine Help Center

How can we help you?


How to: Access Excel data in your Javascript *child* block

The way you should do this is by adding an Excel building block to your app.
Next add the JavaScript block as child of the Excel block, this will allow you to access the data from the Excel block.

You can find information about the JavaScript SDK over here:

Or see the sample I've attached below:

Example main.js
function onLoad(){
document.title = App.Properties.__caption;

window.App.Core.getCurrentRecord(function(record) {

// Will update the current record when the user uses the next/previous buttons on the screen
window.App.on('currentItemChanged', function(record) {


function getRecord(record){
//Record does contain the JSON version of the selected item
//Show a popup with the results of the Excel sheet in JSON format

//Get the DIV with the specific ids and insert the result of the Excel sheet fields
document.getElementById('photo').innerHTML = '<img width="300" height="300" src="'+ record.imageurl +'"/>';
document.getElementById('title').innerText = record.title;
document.getElementById('description').innerText = record.description;

Example of index.html
<!DOCTYPE html>
<html lang="en-us">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JavaScript Block</title>
<script src="" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>

<!-- AppMachine Stylesheet -->
<link rel="stylesheet" type="text/css" href="/bridge/styles.css">
<script src=""></script>
<!-- AppMachine modules -->
<script src="/bridge/core.js"></script>
<script src="/bridge/data.js"></script>

<script src="js/main.js"></script>
<body onload="onLoad()">
<div id="container"></div>
<div id="photo"></div>
<div id="title"></div>
<div id="description"></div>

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request