Dittofi
  • Tutorials
    • Tutorial Index
    • Quick Start
    • Dittofi Essentials
      • Part 1: Frontend terms and concepts
      • Part 2: Backend terms and concepts
      • Part 3: Connecting frontend and backend
      • Part 4: Dittofi app structure
    • Dittofi App Design
      • 🏗️App architecture 101
      • ◼️Backend app development 101
      • 🟪Frontend app development 101
      • 🔰(optional) Web developer beginner series
  • Learn Frontend
    • 👨‍💻Getting Started
      • Welcome to Dittofi
      • Intro to the Dittofi Design Studio (Frontend)
    • 🟩Pages
    • 🟪Elements
      • Types
        • Button Element
        • Div Block Element
        • Form Block Element
        • Link Block Element
        • List Element
        • Modal Box Element
        • Tabs Element
        • Columns Element
        • Image Element
      • Partials
      • Prefabs
      • Custom
    • 🟧Variables
      • Array
      • Checkbox
      • Collection
      • Collection (Custom Model)
      • Collection (System Custom Model)
      • Custom Model
      • Date
      • Datetime
      • File
      • Json
      • Number
      • Number with decimal
      • Model
      • System Custom Model
      • Text
      • UUID
    • 🟨Events
      • 🟨External
        • HTTP Request
        • Run Endpoint
      • 🟨Flow Control
        • Condition
        • Run Action
        • Loop
        • Sleep
      • 🟨Maths
        • Add
        • Divide
        • Modulus
        • Multiply
        • Subtract
      • 🟨Navigation
        • Open Page
      • 🟨Notifications
        • Alert
        • Confirm
      • 🟨Other
        • Copy To Clipboard
        • Run Custom
      • 🟨Text
        • Concat
        • Contains
        • Ends With
        • I Contains
        • I Ends With
        • I Starts With
        • LTrim
        • RTrim
        • Text To Upper
        • Text To Lower
        • Trim
        • Starts With
      • 🟨Variables
        • Set Field
        • Remove Field
      • Validate
    • 🟦CSS Layouts
      • Holy Grail Layout
      • Side Bar Layout
      • Sticky Footer Layout
      • Sticky Header Layout
      • CSS Frameworks
    • 🔲CSS Frameworks
    • Component Libraries
    • Meta Attributes
  • Learn Backend
    • 🖥️Getting Started
      • Intro to Data
      • Intro to APIs
      • Build your first custom API
      • Actions & Events
    • 🟫Back-End Actions
    • 🟩Custom Models
      • 🟩Attributes
        • Array
        • Checkbox
        • Custom Model
        • Collection (Custom Model)
        • Collection (System Custom Model)
        • Date
        • Datetime
        • File
        • Number
        • Number With Decimal
        • Json
        • Text
    • ◼️Data Models
      • Database Fundamentals
        • Database relationships
      • ◼️Columns
        • Attachment
        • Auto Increment
        • Checkbox
        • Date
        • Datetime
        • Duration
        • Email
        • Long text
        • Link to another record field
        • Number
        • Number with decimal
        • Password
        • Phone number
        • Percent
        • Price
        • Rating
        • Single select
        • Single line text
        • URL
    • 🟥Events
      • 🟦Arrays
        • Append
        • Array Pop
        • At
        • Length
        • Prepend
        • Range
      • 🟦Conversions
        • Base64 Encode
        • Base64 Decode
        • Json Decode
        • Json Encode
        • Path Escape
        • Path Unescape
        • Query Escape
        • Query String Parse
        • Query Unescape
        • To Bool
        • To Float
        • To Int
        • To Str
        • Yaml Encode
        • Yaml Decode
      • 🟦Database Requests
        • Create
        • Create Or Update
        • Delete
        • Has Record
        • Read Event
        • Update
      • 🟦External
        • HTTP Request
        • SFTP Download
        • SFTP Upload
      • 🟦Files
        • CSV Reader Event
        • CSV Writer Event
        • File Read
        • File Save
        • File Size
        • File Type
        • JSON Reader
        • PDF Generator
      • 🟦Flow Control
        • Condition
        • Loop
        • Return
        • Run Action
        • Sleep
      • 🟦Notifications
        • Send Mail
        • Connect Websocket
        • Message Websocket
      • 🟦Maths
        • Add
        • Acos
        • Acosh
        • Asin
        • Asinh
        • Atan
        • Atanh
        • Cbrt
        • Ceil
        • Divide
        • Modulus
        • Multiply
        • Subtract
      • 🟦Security
        • Compare Password
        • JWT Decode
        • JWT Encode
        • Login
        • Logout Web User
        • Password Generator
        • Random Number
      • 🟦Time
        • Add Time
        • Day
        • Format Time
        • Minute
        • Nanosecond
        • Parse Time
        • Second
        • Time In
        • Year
        • Year Day
      • 🟦Text
        • Concat
        • Contains
        • Ends With
        • Execute Template
        • I Contains
        • I Ends With
        • I Starts With
        • Starts With
        • LTrim
        • RTrim
        • Replace
        • Regex Find All String
        • Regex Find String
        • Regex Match String
        • Trim
        • Text To Lower
        • Text To Upper
        • Text To Title
        • Url Getarg
      • 🟦Other
        • Assign
        • Run Custom
        • Redirect Web Page Event
        • Render Web Template Event
    • 🟧Variables
      • Array
      • Checkbox
      • Collection
      • Collection (Custom Model)
      • Collection (System Custom Model)
      • Custom Model
      • Date
      • Datetime
      • File
      • Json
      • Number
      • Number with decimal
      • Model
      • System Custom Model
      • Text
      • UUID
    • 🟪Webservices
  • Templates
    • Two sided marketplace template
      • Introduction
        • Part I: Installing and setting up the marketplace template
        • Part II: Understanding what features are included in the marketplace template
        • Part III: Customizing your marketplace frontend without coding
        • Exploring Dittofi's marketplace API
      • Listings
        • How to create a marketplace listing
    • How to build a CRUD app
  • Third Party APIs
    • OAuth 2.0 APIs
      • Introduction To OAuth 2.0
      • Google OAuth 2.0 - PART I
      • Google OAuth 2.0 - PART II
  • Dittofi Admin
    • Your Account
      • Workspace Admin
      • Manage Billing
      • Connect a custom domain
      • How to use a discount code to Dittofi Pro
  • FAQ
    • API Generator
    • How to write custom SQL?
    • Why does my image not display?
    • How can I set up Google Analytics?
    • Exporting and deploying my frontend code
    • What is a partial and what is a prefab?
    • How to set up a basic mulit tenant app on Dittofi
    • How to write a custom endpoint in Dittofi
    • How to integrate Font Awesome into Dittofi
    • How can I set up Dittofi to run on my own private server?
    • How to add roles such as Super Admin, Admin, Manager & User
    • How to prevent duplicate records being added to the database
    • What to do when relation cannot be created because their is violating data in the referenced table
  • Change Logs
    • Dittofi Change Logs
Powered by GitBook
On this page
  • What are back-end actions?
  • The components of a back-end action
  • Creating a back-end action
  • Testing a back-end action
  • What's next?

Was this helpful?

  1. Learn Backend

Back-End Actions

PreviousActions & EventsNextCustom Models

Last updated 1 year ago

Was this helpful?

In this tutorial you will learn:

IMPORTANT

NOTE

What are back-end actions?

Back-end actions are used to give your app functionality.

In this simplistic diagram of an app, you can see:

  • The front-end where your apps users interact with your app.

  • The database which stores data related to your app

  • The back-end application.

The back-end applicaiton is is made up of back-end actions. These actions that sit between your front-end and your database and you can use back-end actions to develop custom functionality for your app such as, logging in users, signing up users, triggering alerts and so on.

Back-end actions can be connected to your apps front-end to make your front-end interactive. They can also be connected to your database.

The components of a back-end action

Inside Dittofi the back-end actions can be found in the back-end actions tab.

You can click on the back-end actions listed in this tab to open them up. The screenshot below shows an example of a back-end action that has been created to sign up a new user.

As you can see, the action is split up into three main parts.

  1. A trigger component, this is what causes the action to start.

  2. Variables that allow you to define variables that can be used throughout your action.

  3. An event chain that defines the functionality that the action is going to perform.

Starting with the action trigger, you can see that actions can be triggered in three main ways. They can be scheduled to run, they can be triggered by other actions or, as in this case here, actions can be triggered by an endpoint.

As shown in the screenshot below, you can configure your endpoint settings here, by clicking on the trigger component and then updating the endpoint path, request method and by setting variables that you’d like to pass into your endpoint.

Variables can also be defined throughout your back-end action. Depending on where in the action you define them, will determine the scope of the variable.

Variables passed into the action from an endpoint are accessible throughout your action.

In the same way, variables defined in the box at the top of your action have global scope within your action, whereas variables defined in the events themselves can only be used within the event itself and all subsequent events. Each event has a response variable, which can be defined inside the event.

Variables can then be passed out of the action, by setting the response variable inside the component trigger. See the example below of passing a success code out of the action.

Last, but not least, there is the event chain that makes up the action. Events are like pre-coded functions that you can pass data into and out of. Events can be chained together to create custom functionality.

For example, the screenshot below shows four events that are chained together to sign up a new user, check that the users data has been correctly written to the database, login the new user and then send them an email.

The events used in the screenshot above are:

  1. Create event, which creates a new user record in the database, that corresponds to the user who is signing up.

  2. Condition event to check that the user has been correctly added to the database

  3. Login event to login the new user of the app

  4. Send email event to welcome the new sign up to our app

In Dittofi we have over 80 events that you can use to build a custom back-end for your app. These events include things like CSV readers, PDF generation, math functions, connecting to web sockets and much much more.

Creating a back-end action

Testing a back-end action

To test a back-end action:

After your action has run, you will get response data from the action.

The response code of 200 indicates that the action has run correctly. The response data is the data that we returned to the trigger endpoint from our action. This can be any variable that you choose.

What's next?

You have now learnt:

  1. What are back-end actions

  2. The main components of a back-end action

  3. How to create a back-end action

  4. How to test a back-end action

Finally, you can check out our marketplace of pre-built back-end actions that can be used to give your app some immediate functionality and dramatically speed up your app development. You can find these on our Templates page under "Modules". As shown below.

If any of the concepts in this tutorial are entirely alien to you, we recommend that you take one of our introductory courses to no-code app development which can be found inside the .

The contains an expanding list of courses developed by professional software engineers and trainers. These courses cover core concepts in app development. There are also guided examples of how professional app developers build specific types of software application.

Tutorials in are developed by both Dittofi and by our amazing community of professional app developers.

You can add new events to this chain by clicking on the button, or by clicking the three dots to the right of each event. This will bring up options to add an event before, after or inside of a condition event.

To create a custom back-end action, click on . Give your action a name, choose a trigger component (endpoint, schedule or action) and then use the different event options to chain together a series of events to perform some custom logic.

(1) Make sure that your code is up to date by clicking , the button

(2) Click

(3) Enter any trigger settings such as entering variables for endpoint triggers, as shown below, and then click

Up next, we advise that you start to experiment with building your own actions and developing your own custom event chains. For a complete list of the events inside Dittofi and how to configure them, check out the section of our docs called .

To see more examples of what you can develop, check-out some of our guided app builds. These show you how professional development teams develop apps using back-end actions. You can find these in our page.

🟫
Dittofi University
Dittofi University
Dittofi University
Events
Dittofi University
What are back-end actions
The components of a back-end action
Creating a back-end action
Testing a back-end action