Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Announcing v3.9 of the Red Hat Mobile Application Platform including Forms Data Sources

April 8, 2016
Conor O'Neill

Share:

    We have just completed the deployment of version 3.9 of the Red Hat Mobile Application Platform to all actively updated Grids.

    Summary

    The main items of note in this release are:

    • Data Sources for Forms
    • Swift Apps can be built in the Build Farm. Our SDKs will move to Swift in a later release
    • New Default Red Hat Forms Theme
    • New Read-Only Text type for Forms which can optionally use Data Sources
    • Performance improvements and bug fixes for Forms

    Forms Data Sources

    The major new feature of this release is Data Sources for Forms which I'm really pleased to tell you about.

    As you may know, our Forms Builder enables you to generate mobile applications with a dynamic set of Forms that contain both standard web controls and mobile-specific controls like location capture, signature, maps, etc. These apps can be auto-generated, then built in our Build Farm and distributed in our Enterprise App Store without ever seeing a line of code.

    Data Sources builds on this by enabling your developers to create reusable data sets from your back-end systems that non-developers can then attach to Forms elements.

    • You can create custom Data Sources that can connect to any back-end system
    • You can set the update schedule for contents returned by the Data Source
    • You implement each Data Source as an MBaaS Service in Node.js
    • We provide three example Data Sources as starting points - Static File, MongoDB and Internet
    • You can populate various Form fields from Data Sources including drop-downs and radio-boxes
    • You can display read-only textual information from Data Sources in Forms using a new field type
    • Non-technical users can make use of Data Sources without coding
    • You can share Data Sources across Forms
    • Multiple Data Sources can be served on different URLs from one MBaaS Service

    The easiest way to get started is to use one of our examples. Lets create a Data Source which pulls information from a remote CSV file and makes it usable in a Drop Down field in a Form.

    Create a Data Source Service

    1. In the Studio, navigate to Services & APIs. Click Provision MBaaS Service/API.
    2. On the left, choose the Data Sources category.
    3. Select the Static Data Source template
    4. Choose a name for the service and deploy it to an environment.
    5. Go to Service Details and make the Service public and then re-deploy when instructed to

    Customise the Data Source Service to work with CSV

    1. Go to the Editor for the Service and change application.js to add the second line here in the appropriate location:
      app.use('/static_ds', require('./lib/static-datasource.js'));
      app.use('/csv_ds', require('./lib/csv-datasource.js'));
    2. Browse to the lib directory in the Editor and create csv-datasource.js with the following contents:
      var express = require('express');
      var request = require('request');
      var router = express.Router();
      
      router.get('/', function (req, res) {
      
      var url = 'https://gist.githubusercontent.com/conoro/2090f52225832787766b3340c1c3caaf/raw/847108af1026bc07c42297ac699e0dbdc3a12195/workers.csv';
      
      request(url, function (err, resp, html) {
      if (err) {
      console.log(err)
      return handleError(err, res);
      }
      var people = [];
      
      var lines = html.toString().split('\n');
      for (var i = 0; i < lines.length; i++) {
      people.push({"key": i, value: lines[i].toString().split(',')[0], selected: true});
      }
      res.send(people);
      
      });
      });
      
      module.exports = router;
    3. The code above simply reads the remote CSV file and converts it to the specific JSON format we need. Your code here can be as complex as you need to get at the data you want and crunch it down to the data sets for your forms.
    4. You can view the example CSV I've created over on GitHub Gist. You could host your data anywhere. My example is a simple single column CSV file with a list of names.
      Roger Flopple,
      Demetrius Levenworth,
      Salamander Hammerhead,
      Ferrari Montenegro,
      Paul Corduroy,
      Hank Fracas,
      Ludwig Von Instagram,
      Lisa Toboggan,
      Heather Kerfuffle,
      Rebecca Beretta,
      Lindsay McMartinhamson,
      Mirandella Houndstooth,
    5. Edit package.json to add the request module in this location:
      "express": "^4.13.3",
      "fh-mbaas-api": "5.9.1",
      "request": "~2.40.0"
      },
    6. Re-deploy the Service code with those changes
    7. Get the URL of your Service in its details page and browse to https://the.url.of.the.service/csv_ds and you should see a JSON version of your CSV returned.
      [{"key":0,"value":"Roger Flopple","selected":true},{"key":1,"value":"Demetrius Levenworth","selected":true},{"key":2,"value":"Salamander Hammerhead","selected":true},{"key":3,"value":"Ferrari Montenegro","selected":true},{"key":4,"value":"Paul Corduroy","selected":true},{"key":5,"value":"Hank Fracas","selected":true},{"key":6,"value":"Ludwig Von Instagram","selected":true},{"key":7,"value":"Lisa Toboggan","selected":true},{"key":8,"value":"Heather Kerfuffle","selected":true},{"key":9,"value":"Rebecca Beretta","selected":true},{"key":10,"value":"Lindsay McMartinhamson","selected":true},{"key":11,"value":"Mirandella Houndstooth","selected":true}]

      This is the format the Data Source needs.

    Create the Data Source

    1. In the Studio, navigate to Drag & Drop Apps > Data Sources. Click New Data Source.
    2. Set a name and a description. Both are required.
    3. Choose your previously created MBaaS service and set /csv_ds as its endpoint
    4. Check you have done everything correctly using the Validate button
    5. Leave the other settings as they are
    6. Click Create Data Source

    Using the Data Source in a Form

    Note, these steps can be carried out by non-developers. Once you have your Data Sources setup and configured the access to them, your Forms creators can then make use of them without having to know the technical details of where the data is coming from.

    1. Navigate to Drag & Drop Apps > Forms Builder
    2. Open an existing form, or create a new form.
    3. Drag a Dropdown field on to the Form and select the created field
    4. In the Options section, check Use a Data Source
    5. Select the data source created in the previous step
    6. Save and deploy the form.
    7. See the data in the dropdown in the Forms Preview or just Build the App and use it

     

    You can read more of the technical information here and here on our Docs site.

    We're looking forward to seeing how you make use of this new feature set that many of you have been eager to try.

    Last updated: March 16, 2018

    Recent Posts

    • Storage considerations for OpenShift Virtualization

    • Upgrade from OpenShift Service Mesh 2.6 to 3.0 with Kiali

    • EE Builder with Ansible Automation Platform on OpenShift

    • How to debug confidential containers securely

    • Announcing self-service access to Red Hat Enterprise Linux for Business Developers

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue