Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Jolt Transformation returning null values

avatar
Explorer

Hi, I'm trying to get this JOLT working, but in some cases, in the output is printing null values. The qty of itens inside RUBRICS array is dynamic. What am I doing wrong ? 


Payload

 

[
  {
    "ENTITY_DOCUMENT": "11",
    "ENTITY_ID": "",
    "ENTITY_TYPE": "TEST_CARD",
    "CLOSED": true,
    "CALCULATION_DATE": "2023-11-01",
    "RUBRICS": [
      {
        "name": "provisao_TEST_card",
        "classification": "",
        "code": "",
        "amount": 110.08,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      }
    ]
  },
  {
    "ENTITY_DOCUMENT": "12",
    "ENTITY_ID": "",
    "ENTITY_TYPE": "TEST_CARD",
    "CLOSED": true,
    "CALCULATION_DATE": "2023-11-01",
    "RUBRICS": [
      {
        "name": "provisao_TEST_card",
        "classification": "",
        "code": "",
        "amount": 120.08,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      }
    ]
  },
  {
    "ENTITY_DOCUMENT": "13",
    "ENTITY_ID": "",
    "ENTITY_TYPE": "TEST_CARD",
    "CLOSED": true,
    "CALCULATION_DATE": "2023-11-01",
    "RUBRICS": [
      {
        "name": "app_TEST_card",
        "classification": "",
        "code": "",
        "amount": 1301.34,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "cred_cofins_cashback_TEST_card",
        "classification": "",
        "code": "",
        "amount": 140.16,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "consumo_TEST_card",
        "classification": "",
        "code": "",
        "amount": 150.35,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "consumo_TEST_card_manual",
        "classification": "",
        "code": "",
        "amount": 160.94,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "cred_pis_cashback_TEST_card",
        "classification": "",
        "code": "",
        "amount": 170.45,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "breakage_TEST_card",
        "classification": "",
        "code": "",
        "amount": 180.85,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "pis_breakage_TEST_card",
        "classification": "",
        "code": "",
        "amount": 190.01,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "perda_adquirencia_TEST_card",
        "classification": "",
        "code": "",
        "amount": 200.77,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "cofins_breakage_TEST_card",
        "classification": "",
        "code": "",
        "amount": 210.04,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "consumo_TEST_card_cashback",
        "classification": "",
        "code": "",
        "amount": 220.49,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      },
      {
        "name": "cashback_TEST_card",
        "classification": "",
        "code": "",
        "amount": 230.33,
        "type": "",
        "business_unit": "TEST",
        "aggregation_key": ""
      }
    ]
  }
]

 


Specs

 

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "RUBRICS": {
          "*": {
            "@name": "&[&3].RUBRIC",
            "@business_unit": "&[&3].COMPENSATION_GROUP",
            "@classification": "&[&3].CLASSIFICATION",
            "@code": "&[&3].CODE",
            "@amount": "&[&3].AMOUNT",
            "@type": "&[&3].TYPE",
            "@aggregation_key": "&[&3].AGGREGATION_KEY",
            "@(2,ENTITY_TYPE)": "&[&3].ENTITY_TYPE",
            "@(2,ENTITY_ID)": "&[&3].ENTITY_ID",
            "@(2,ENTITY_DOCUMENT)": "&[&3].ENTITY_DOCUMENT",
            "@(2,CALCULATION_DATE)": "&[&3].CALCULATION_DATE"
          }
        }
      }
    }
  },
  {
    "operation": "shift",
    "spec": {
      "*": {
        "*": ""
      }
    }
  }
]

 

 Output
[ {
"RUBRIC" : "provisao_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 110.08,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "11",
"CALCULATION_DATE" : "2023-11-01"
}, {
"RUBRIC" : "provisao_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 120.08,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "12",
"CALCULATION_DATE" : "2023-11-01"
}, {
"RUBRIC" : "app_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 1301.34,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "cred_cofins_cashback_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 140.16,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "consumo_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 150.35,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "consumo_TEST_card_manual",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 160.94,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "cred_pis_cashback_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 170.45,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "breakage_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 180.85,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "pis_breakage_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 190.01,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "perda_adquirencia_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 200.77,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "cofins_breakage_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 210.04,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "consumo_TEST_card_cashback",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 220.49,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
}, null, null, {
"RUBRIC" : "cashback_TEST_card",
"COMPENSATION_GROUP" : "TEST",
"CLASSIFICATION" : "",
"CODE" : "",
"AMOUNT" : 230.33,
"TYPE" : "",
"AGGREGATION_KEY" : "",
"ENTITY_TYPE" : "TEST_CARD",
"ENTITY_ID" : "",
"ENTITY_DOCUMENT" : "13",
"CALCULATION_DATE" : "2023-11-01"
} ]


1 ACCEPTED SOLUTION

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
2 REPLIES 2

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Explorer

Hi @SAMSAL. Now it is clear to me why it wasn't working. JOLT has a tricky learning curve, isn't it ? 

I do appreciate your attention on helping me. 

Thanks !!!!