PricingDocsAcademy
Bluesky ...
Fri, Dec 13, 8:33 AM

How do I use data from an API call as inputs for an Apex Graph, like in the dashy template?

  • Hausia

    1 month ago

    Looking to use data pulled from Airtable as inputs for a line graph.
  • Chris Laupama

    1 month ago

    There’s definitely a number of ways to do this.

    One would be to save the data upon success of the API call to a variable.

    Then use the data from that variable within the graph.
  • /attachments/1305299186517938226/1305308839582765167/Zight_Recording_2024-11-11_at_12.06.51_PM.mp4

    Chris Laupama

    1 month ago

  • /attachments/1305299186517938226/1305347556548804608/Screenshot_2024-11-11_at_2.44.14_PM.png

    Hausia

    1 month ago

    I'm actually pretty proud of myself, I had set everything up just the way you did haha

    But he's actually not using table data for that graph, just manual inputs (see screenshot)

    I want to know how to use arguments with actions.
    Screenshot_2024-11-11_at_2.44.14_PM.png
    ❤️1
  • /attachments/1305299186517938226/1305351410401021973/Screenshot_2024-11-11_at_3.00.15_PM.png

    Hausia

    1 month ago

    This is what I want to use
    Screenshot_2024-11-11_at_3.00.15_PM.png
  • Tod

    1 month ago

    Great energy @Hausia! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
  • Chris Laupama

    1 month ago

    Arguments are just a way to pass data into the custom action.

    So think of them as variables.

    You create an argument, let’s say you create an argument called “name” then within the code you use the argument by using 'args.name'

    In that screenshot you can see on line 4 and 49 they are using 'args.containerId'
  • Chris Laupama

    1 month ago

    Okay, you will need to ensure you are shaping the data to utilise it the way that the apex library requires it to be utilised.

    Lots of ways to do that.

    We can jump on a call at some point if you want to go over it bro.
  • Hausia

    1 month ago

    Free now?
  • @Hausia
    Free now?

    Chris Laupama

    1 month ago

    Sweet ping me with meeting link
  • Hausia

    1 month ago

    Sent
  • /attachments/1305299186517938226/1305373316743430245/Screen_Recording_2024-11-11_at_4.22.04_PM.mov

    Chris Laupama

    1 month ago

    @Victor Giron & @Lucas G

    Any thoughts?

    Trying to use the airtable data, but I think the custom action is loading before the Airtable data comes through.

    I've set a console log to show the array that passes to the custom action and it's showing it with an array of 3 empty items...

    Here's the project link: https://toddle.dev/projects/peach_tion_medon_busy_rhinoceros
  • Lucas G

    1 month ago

    Test running the custom action on success of the API call
  • Use the 'isLoading' part of the call to set a placeholder graph/img
    💯1
  • Or just a spinner loader
  • Chris Laupama

    1 month ago

    Omg, didn't even think about that lol
  • Yeah, that worked
  • Legend, thank you!
    👍1
  • Hausia

    1 month ago

    @Chris Laupama english please hahaha
    😂1

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.