parsing multiple dictionary view ...

I'm currently integrating to an existing Mule service which on query returns me in the result set the following :

body: Dictionary
            workflowHistory: List of Dictionary: 14 items
                Dictionary
                    DATA1RECEIVED: Dictionary
                        F1: "DATA1"
                        F2: "DATA2"
                        F3: "On"
                        Date: "20-SEP-04 10.56.24.000000 AM"
                        Date2: "06-SEP-04 12.00.00.000000 AM"
                        F4: "Y"
                        F5: "Done"
                        F6: 200095
                        F7: null (Null)
                Dictionary
                    DATADOCUMENTS: Dictionary
                        F1: "DATA1"
                        F2: "DATA2"
                        F3: "On"
                        Date: "20-SEP-04 11.39.35.000000 AM"
                        Date2: "20-SEP-04 12.00.00.000000 AM"
                        F4: "N"
                        F5: "Transferred"
                        F6: 200097
                        F7: null (Null)
and so on ....

 

I wish to build a pagingGrid that references (for example) F1,F3,Data

I can't use .notation as the dictionarys are different, so local!results.DATA1RECEIVED.F1 will only give me DATA1RECEIVED and null for the rest of the set.
I need some sort of wildcard for the dictionary ? I've tried to use flatten but no luck and Index (array,"F1",{}) but neither work ....

 

  Discussion posts and replies are publicly visible

Parents
  • Hi paul,

    Please try the below code snippet.

    load(
    local!pagingInfo: a!pagingInfo(
    1,
    - 1
    ),
    local!data: {
    DATA1RECEIVED: {
    F1: "Dev",
    F2: "DATA2",
    F3: "On",
    Date: "20-SEP-04 10.56.24.000000 AM",
    Date2: "06-SEP-04 12.00.00.000000 AM",
    F4: "Y",
    F5: "Done",
    F6: 200095,
    F7: 0
    },
    DATADOCUMENTS: {
    F1: "Test",
    F2: "DATA2",
    F3: "On",
    Date: "20-SEP-04 10.56.24.000000 AM",
    Date2: "06-SEP-04 12.00.00.000000 AM",
    F4: "Y",
    F5: "Done",
    F6: 200095,
    F7: 0
    }
    },
    {
    a!gridField(
    totalCount: 2,
    columns: {
    a!gridTextColumn(
    label: "F1",
    data: a!forEach(
    items: {
    index(
    local!data,
    "DATA1RECEIVED",
    {}
    ),
    index(
    local!data,
    "DATADOCUMENTS",
    {}
    )
    },
    expression: fv!item.F1
    )
    ),
    a!gridTextColumn(
    label: "F3",
    data: a!forEach(
    items: {
    index(
    local!data,
    "DATA1RECEIVED",
    {}
    ),
    index(
    local!data,
    "DATADOCUMENTS",
    {}
    )
    },
    expression: fv!item.F3
    )
    ),

    },
    value: local!pagingInfo,
    saveInto: local!pagingInfo
    )
    }
    )

    Hope it helps!!!

    Thanks,
    Hema
Reply
  • Hi paul,

    Please try the below code snippet.

    load(
    local!pagingInfo: a!pagingInfo(
    1,
    - 1
    ),
    local!data: {
    DATA1RECEIVED: {
    F1: "Dev",
    F2: "DATA2",
    F3: "On",
    Date: "20-SEP-04 10.56.24.000000 AM",
    Date2: "06-SEP-04 12.00.00.000000 AM",
    F4: "Y",
    F5: "Done",
    F6: 200095,
    F7: 0
    },
    DATADOCUMENTS: {
    F1: "Test",
    F2: "DATA2",
    F3: "On",
    Date: "20-SEP-04 10.56.24.000000 AM",
    Date2: "06-SEP-04 12.00.00.000000 AM",
    F4: "Y",
    F5: "Done",
    F6: 200095,
    F7: 0
    }
    },
    {
    a!gridField(
    totalCount: 2,
    columns: {
    a!gridTextColumn(
    label: "F1",
    data: a!forEach(
    items: {
    index(
    local!data,
    "DATA1RECEIVED",
    {}
    ),
    index(
    local!data,
    "DATADOCUMENTS",
    {}
    )
    },
    expression: fv!item.F1
    )
    ),
    a!gridTextColumn(
    label: "F3",
    data: a!forEach(
    items: {
    index(
    local!data,
    "DATA1RECEIVED",
    {}
    ),
    index(
    local!data,
    "DATADOCUMENTS",
    {}
    )
    },
    expression: fv!item.F3
    )
    ),

    },
    value: local!pagingInfo,
    saveInto: local!pagingInfo
    )
    }
    )

    Hope it helps!!!

    Thanks,
    Hema
Children
No Data