Legacy Dev Forum Posts

 View Only

Sign Up

Retrieve whole Data Table via Data Action

  • 1.  Retrieve whole Data Table via Data Action

    Posted 06-05-2025 18:45

    Eystein_Kylland | 2024-01-04 13:56:36 UTC | #1

    Hello I use Data Action and retrieve the whole content of and Data Table: /api/v2/flows/datatables/e730966b-cfa5-4f74-846b-929984369f33/rows/?showbrief=false

    This is the config in Response: { "translationMap": {}, "translationMapDefaults": {}, "successTemplate": "{\"ROW\" : \"$esc.jsonString(${rawResult})\"}" }

    I then get this output: { "entities" : [ { "Word" : "Terminate", "Word1" : "Krypto", "key" : "1" }, { "Word" : "Terminate", "Word1" : "Spam", "key" : "3" } ], "pageSize" : 25, "pageNumber" : 1, "total" : 2, "pageCount" : 1}

    What is the best way to get the key=word1 from this structure in archtiect? Would like to make a lot the loop through all the values of word1 one by one


    Jason_Mathison | 2024-01-09 18:20:58 UTC | #2

    I think that this is what you are looking for. This will return a "Values" variable that is a list of strings.

    {
      "translationMap": {"Values" : "entities[*].Word_1"},
      "translationMapDefaults": {},
      "successTemplate": "{\"Values\" : ${Values}}"
    }

    --Jason


    Eystein_Kylland | 2024-01-10 08:55:00 UTC | #3

    Thanks. Then I get this into architect: { "entities" : [ { "key" : "Spam" }, { "key" : "Virus" } ], "pageSize" : 25, "pageNumber" : 1, "total" : 2, "pageCount": 1}

    In architect I try to get the key/value pair key out one by one. What is the best function to do that? I have tried different syntax of this function ToString(GetJsonObjectProperty(GetJsonObjectProperty(Flow.JsonWords,"entities"),"key")[0])

    Flow.JsonWords is Json structure


    Jason_Mathison | 2024-01-10 14:49:13 UTC | #4

    If you use the approach I gave you above you should only have an output of "Values" that will be an list of strings, no need for any JSON processing.


    Eystein_Kylland | 2024-01-16 07:40:19 UTC | #5

    Thanks for the answers. It solved my problem


    system | 2024-02-16 07:40:36 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 23938