PricingBlog

I would like to store information from an API call (Supabase) in a variable.

  • larshaehre-1268558652130857040

    Lars Hæhre

    1 year ago

    I am going to use only some of the information that returns from an API call, and don't need the other.

    The API call returns the name of several users (for example 10 users). However I do also get other information for each user (email, adress, etc.). I want only to store the names for all the users in a variable.

    The information from the API call is return as an object, with
    0 -> name, email, adress
    1 -> name, email, adress
    2 -> name, email, adress
    3 -> name, email, adress
    ... and so on.

    However, I only want the names to be stored in a variable (named userNames) as a string: name 0, name 1, name 2, name 3

    Any ideas on what formulas I can use to get this? Or how I manage to just extract the names from the API call?
  • lucasg-1268559085473763338

    Lucas G

    1 year ago

    You can use the ‘select’ query in your API call to only fetch the name column
  • Alternatively, you can use the Map node to make a new array with only the name values
  • larshaehre-1268561779047403650

    Lars Hæhre

    1 year ago

    Allrights. Thanks that works 🙂