GithubHelp home page GithubHelp logo

budibase-embeddedscript's Introduction

Budibase-embeddedscript

This append scripts to your current screen and use a table to store them.

Description

Embed js scripts from your databse into your app

Find out more about Budibase.

Instructions

Create a table with the following columns:

  • content (text) A valid URL pointing to a JS file or JS code with handlebars

  • collection (options or text) Collection name to group scripts

  • parent (options with values: head, body, component) Where the script should be appended

  • inBuilder (boolean) Does the script execute in Builder

    image

Add the component, select your newly created table and filter by collection name if needed.

You can expose values to the handlebars context via the Context Object.

Example value

return { CurrentUser: $("Current User.email"), search: $("State.search_text")};

Then use {{ CurrentUser }} in your script's content

Example

To add Google Analytics tracking

Row 1 (loading external script):

content: https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX
collection: analytics
parent: head
inBuilder: false

Row 2 (init gtag object):

content: window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());    gtag('config', 'G-XXXXXXXXX');
collection: analytics
parent: body
inBuilder: false

Known issues

  • Handlebars are parsed but can't access the live Budibase context

Instructions for devs

To build your new plugin run the following in your Budibase CLI:

budi plugins --build

You can also re-build everytime you make a change to your plugin with the command:

budi plugins --watch

budibase-embeddedscript's People

Contributors

diogenesbrussels avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.