AutoWeb Navigating a Json Array, output in order.

Discussion in 'AutoApps' started by Gab8, Feb 18, 2020.

  1. Gab8

    Gab8 New Member

    Joined:
    Feb 18, 2020
    Messages:
    3
    Likes Received:
    0
    Hello everyone, how are you? I'm trying to set an API that pulls some financial data in Json format, and while I can get the info, I cannot get it to properly display in a readable fashion. For example:

    {
    "title": [
    {
    "simbol": "A2E2",
    "price": 4050.000,
    "var": -4.70,
    },
    {
    "simbol": "A2E2D",
    "price": 50.000,
    "var": -1.96,

    },
    Let's say I have a Json like that. AutoWeb automatically parses "simbol" and "var" to arrays, but if I would want to print the info out to a file doing the Write File Action using in the text: "%simbol(), Var: %var()" , it will print first all the values in Simbol , then the "Var:" text and finally all the other values in the other array

    Is there a way to print or save the information to be something like:
    A2E2 , Var: -4.70
    A2E2D, Var: -1.96
    ... and so on.

    Thanks in advance!
     
    Last edited: Feb 18, 2020
  2. Gab8

    Gab8 New Member

    Joined:
    Feb 18, 2020
    Messages:
    3
    Likes Received:
    0
    The best I could do is use the autotools array merger to create items like "A2E2, VAR: -4.70, A2E2D, Var: -1.96 .... " and so on, but doing that I lose control of the invidivual fields inside the items. For example if I would like to create a button that has an action called "sell_%simbol" , which would be something like "Sell A2E2", I wouldn't be able to do so since I only have one field
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You're on the right track :)

    Use the AutoTools Array action to merge all the arrays into one, then for those variables that you want to use separately simply don't include them in the merged array :)
     
: Json, AutoWeb

Share This Page