# Simple Custom Action Walkthrough

#### Example: Getting a Daily Joke From an API

Let’s say you want your app to tell a joke when someone taps a “Make Me Laugh” button. You can do this by connecting to a public joke API.

1. **Add a Button**\
   On your screen, add a button and label it **“Make Me Laugh.”**

   <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2F9Tc1xuzrhtsSDABgJnbm%2Fimage.png?alt=media&#x26;token=b6810a6b-e8c1-45a2-b22c-2cc29e17f1e3" alt="" width="563"><figcaption></figcaption></figure>

2. **Create a Custom Action**\
   Select the button, click **Add Action**, and choose **Custom Action**. Scroll down to **+New Custom Action.**

   <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FzCgRNh0ReX3hGQaq7tdx%2FScreenshot%202025-10-28%20at%2012.27.21%E2%80%AFPM.png?alt=media&#x26;token=9a7665e9-2666-4a6e-b364-abb027607489" alt="" width="299"><figcaption></figcaption></figure>

3. **Set Up the Request**
   * Method: `GET`
   * URL: `https://official-joke-api.appspot.com/jokes/random`
   * You don’t need headers or a body for this one — it’s ready to go.

4. **Run Test Request**\
   Click **Run Test Request.**&#x20;

   <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FXozm8vJrsBGGZFbnKMwS%2Fimage.png?alt=media&#x26;token=33e81bd4-c6f6-45a5-b1f5-10dbac7de0b9" alt="" width="563"><figcaption></figcaption></figure>

5. **View Response**
   * Click **Show Full Response**
   * You’ll see a JSON response that looks like this:

     ```json
     {
       "type": "general",
       "setup": "Why don’t skeletons fight each other?",
       "punchline": "They don’t have the guts."
     }
     ```

6. **Add Outputs**

   * Click **+Add Item**

     <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2F1T5u5zTWO8V31Wp4vLR8%2Fimage.png?alt=media&#x26;token=f5b75ae3-f823-42aa-89af-9f5e16623c2c" alt="" width="563"><figcaption></figcaption></figure>
   * Add `setup` and `punchline` as Text fields

   <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2F8kOyyaQ7B5rx6tsqC7qD%2Fimage.png?alt=media&#x26;token=63630b37-837e-4c6a-8a46-b4aaa1b0392d" alt="" width="375"><figcaption></figcaption></figure>

   * Save your Custom Action

7. **Display the Joke**

   * Add Input components to Display the ***setup*** and ***punchline***
   * Add an Action on the Button following the Custom Action which Changes the Input Value for each output.&#x20;

     <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2F1WoaUCmRmsRO4qVFKmrO%2Fimage.png?alt=media&#x26;token=1c349497-c599-4272-a320-31d546db6400" alt="" width="375"><figcaption></figcaption></figure>

     <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FGpCw6L7ITkzKFa6DQHcA%2Fimage.png?alt=media&#x26;token=1f5c6359-3843-4264-89bb-f3de1b4e1d12" alt="" width="375"><figcaption></figcaption></figure>

8. **Preview and Test**<br>

   <figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FzStSHL4MMQ1Q7Z3netDx%2F2a24ac9c-de0c-42ec-9b36-5d125b011d33.gif?alt=media&#x26;token=5373519f-054d-404b-9865-29b40a817917" alt="" width="563"><figcaption></figcaption></figure>

Now, every time someone taps **Make Me Laugh**, your app will fetch a brand-new joke from the API and display it instantly.

If you wish to use the output to **update or create a record** in your Adalo database, you can add a follow-up **Update** or **Create** action after your Custom Action. From there, use the Outputs from your Custom Action to set properties in a collection.

For example, you could create a new property in the Logged-in-User record named ***Daily Laugh.*** After running a Custom Action that returns a Joke, you could update the Logged in User Property to the Custom Action → ***Setup/Punchline*** output.
