PricingBlog

How to create a formula that takes in "location" as a parameter and returns a string?

  • lululucaschae-1225838525614915724

    lululucaschae

    1 year ago

    Hi! Day 1 playing around with Toddle, and I'm already having so much fun! Yes, a lot of features do feel prototype-y, but I haven't faced any major issues so far.

    Using the "location" package and the googleMapsLocationLink method, I was able to return the google maps url as you can see in the first screenshot.

    However, when I try to write my own custom formula (third screenshot), that takes in a "location" object as a parameter and return a new url string, I keep getting a null value (second screenshot).

    I've only done mobile dev (flutter & ios) the past couple of years, so my js is super rusty. Can anyone give me some insight on how to fix this?
    1225838526046666862-Screenshot_2024-04-06_at_12.52.52_AM.png
    1225838526470557706-Screenshot_2024-04-06_at_12.53.09_AM.png
    1225838526818680934-Screenshot_2024-04-06_at_12.53.25_AM.png
  • lululucaschae-1225839973673209946

    lululucaschae

    1 year ago

    How to create a formula that takes in "location" as a parameter and returns a string?
  • andreasmoller-1225842620706721822

    Andreas Møller

    1 year ago

    Not sure what the problem is. Try refreshing your browser
    🙏1
  • Might be that it didn’t load the formula properly
    🥲1
  • lululucaschae-1225847310358151178

    lululucaschae

    1 year ago

    Hmm, refreshing the browser did not resolve it.

    Doees the method setup look okay? I mean it makes sense to me, but I'm really not too familiar with js syntax so I might be missing something really obvious.
  • lululucaschae-1225861451802214422

    lululucaschae

    1 year ago

    It was indeed problem with my method.

    Clling GeolocationPosition.coords was returning "undefined", because I can't return from a callback.