<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Copy Field value from one list to another using JOLT in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390886#M247376</link>
    <description>&lt;P&gt;I guess Im having hard time understanding what are you trying to do . In the first post you said you are just wanting to copy the value from Currency Condition into Calculate Pricee, so I assumed there is always going to be one value in the Currency Condition Array, but now you are saying can be dynamic and it can change . So what are the rules here in case you have multiple values? how do you decide? Can you specify the different scenarios that you would have in the input and what is the expected output for each ?&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 21:52:19 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2024-07-23T21:52:19Z</dc:date>
    <item>
      <title>Copy Field value from one list to another using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390828#M247353</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Could you please help me what i am missing here.. i am trying to copy currency value from currency condition and adding it in&amp;nbsp;calculatePrice array.&lt;/P&gt;&lt;P&gt;Input&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "tiers": [
    {
      "rewards": [
        {
          "rewardId": 8127,
          "changeType": 2,
          "changeAmount": 15,
          "changePercent": null,
          "quantityToDiscount": null,
          "applyInd": 2,
          "rewardsMerch": []
        }
      ],
      "priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_CURR_CONDITION",
          "values": [
            "AED"
          ]
        }
      ]
    },
    {
      "rewards": [
        {
          "rewardId": 8128,
          "changeType": 2,
          "changeAmount": 18,
          "changePercent": null,
          "quantityToDiscount": null,
          "applyInd": 2,
          "rewardsMerch": []
        }
      ],
      "priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_CURR_CONDITION",
          "values": [
            "USD"
          ]
        }
      ]
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;Spec&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "tiers": {
        "*": {
          "priceRuleAttributes": {
            "*": {
              "id": {
                "PR_CURR_CONDITION": {
                  "@(2,values[0])": "paths.[&amp;amp;5].currencyCondition[#2].currency"
                }
              }
            }
          },
          "rewards": {
            "*": {
              "changeType": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].calculationType",
              "changeAmount": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].amount",
              "changePercent": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].percentage"
            }
          }
        }
      }
    }
  },
  {
    "operation": "modify-default-beta",
    "spec": {
      "paths": {
        "*": {
          "calculatePrice": {
            "*": {
              "currency": "@(0,currencyCondition[&amp;amp;].currency)"
            }
          }
        }
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;Expected output&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "paths" : [ {
    "currencyCondition" : [ {
      "currency" : "AED"
    } ],
    "calculatePrice" : [ {
      "calculationType" : 2,
      "amount" : 15,
      "percentage" : null,
      "currency" : "AED"
    } ]
  }, {
    "currencyCondition" : [ {
      "currency" : "USD"
    } ],
    "calculatePrice" : [ {
      "calculationType" : 2,
      "amount" : 18,
      "percentage" : null,
      "currency" : "AED"
    } ]
  } ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 05:12:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390828#M247353</guid>
      <dc:creator>Syed0000</dc:creator>
      <dc:date>2024-07-23T05:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field value from one list to another using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390848#M247357</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you can do this part of the first shift spec unless Im missing something:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "tiers": {
        "*": {
          "priceRuleAttributes": {
            "*": {
              "id": {
                "PR_CURR_CONDITION": {
                  "@(2,values[0])": "paths.[&amp;amp;5].currencyCondition[#2].currency"
                }
              }
            }
          },
          "rewards": {
            "*": {
              "changeType": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].calculationType",
              "changeAmount": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].amount",
              "changePercent": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].percentage",
              "@(2,priceRuleAttributes[0].values[0])": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].currency"
            }
          }
        }
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 09:44:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390848#M247357</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-07-23T09:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field value from one list to another using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390876#M247368</link>
      <description>&lt;P&gt;In that case you made it static as&amp;nbsp;priceRuleAttributes array can have multiple dynamic values and its index can be change for&amp;nbsp;PR_CURR_CONDITION.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_BRANCH_NAME",
          "values": [
            "MEMBERS"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_PRICE_RULE_PROMO",
          "valueBoolean": true
        },
        {
          "type": "CFA",
          "id": "PR_TARGET_SEGMENT",
          "values": [
            "PAS_LOGGEDIN",
            "LOGGEDIN",
            "PAS_NOT_LOGGEDIN"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_CURR_CONDITION",
          "values": [
            "AED"
          ]
        }
      ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 17:44:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390876#M247368</guid>
      <dc:creator>Syed0000</dc:creator>
      <dc:date>2024-07-23T17:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field value from one list to another using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390886#M247376</link>
      <description>&lt;P&gt;I guess Im having hard time understanding what are you trying to do . In the first post you said you are just wanting to copy the value from Currency Condition into Calculate Pricee, so I assumed there is always going to be one value in the Currency Condition Array, but now you are saying can be dynamic and it can change . So what are the rules here in case you have multiple values? how do you decide? Can you specify the different scenarios that you would have in the input and what is the expected output for each ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 21:52:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390886#M247376</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-07-23T21:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field value from one list to another using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390932#M247403</link>
      <description>&lt;P&gt;Sorry i shared simplified input JSON, here is input so&amp;nbsp;priceRuleAttributes array can have more than one value or can be empty.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "tiers": [
    {
      "rewards": [
        {
          "rewardId": 8127,
          "changeType": 2,
          "changeAmount": 15,
          "changePercent": null,
          "quantityToDiscount": null,
          "applyInd": 2,
          "rewardsMerch": []
        }
      ],
      "priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_BRANCH_NAME",
          "values": [
            "MEMBERS"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_PRICE_RULE_PROMO",
          "valueBoolean": true
        },
        {
          "type": "CFA",
          "id": "PR_TARGET_SEGMENT",
          "values": [
            "PAS_LOGGEDIN",
            "LOGGEDIN",
            "PAS_NOT_LOGGEDIN"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_CURR_CONDITION",
          "values": [
            "AED"
          ]
        }
      ]
    },
    {
      "rewards": [
        {
          "rewardId": 8128,
          "changeType": 2,
          "changeAmount": 18,
          "changePercent": null,
          "quantityToDiscount": null,
          "applyInd": 2,
          "rewardsMerch": []
        }
      ],
      "priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_BRANCH_NAME",
          "values": [
            "MEMBERS"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_CURR_CONDITION",
          "values": [
            "USD"
          ]
        }
      ]
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "paths" : [ {
    "currencyCondition" : [ {
      "currency" : "AED"
    } ],
    "calculatePrice" : [ {
      "calculationType" : 2,
      "amount" : 15,
      "percentage" : null,
      "currency" : "AED"
    } ]
  }, {
    "currencyCondition" : [ {
      "currency" : "USD"
    } ],
    "calculatePrice" : [ {
      "calculationType" : 2,
      "amount" : 18,
      "percentage" : null,
      "currency" : "USD"
    } ]
  } ]
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Jul 2024 13:34:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390932#M247403</guid>
      <dc:creator>Syed0000</dc:creator>
      <dc:date>2024-07-24T13:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field value from one list to another using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390982#M247421</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Sorry for the delay. See if this will work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "tiers": {
        "*": {
          "priceRuleAttributes": {
            "*": {
              "id": {
                "PR_CURR_CONDITION": {
                  "@(2,values[0])": "paths.[&amp;amp;5].currencyCondition[#2].currency"
                }
              }
            }
          },
          "rewards": {
            "*": {
              "changeType": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].calculationType",
              "changeAmount": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].amount",
              "changePercent": "paths.[&amp;amp;3].calculatePrice[&amp;amp;1].percentage",
              "@(2,priceRuleAttributes)": {
                "*": {
                  "id": {
                    "PR_CURR_CONDITION": {
                      "@(2,values[0])": "paths.[&amp;amp;7].calculatePrice[&amp;amp;4].Currency"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Jul 2024 17:53:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Copy-Field-value-from-one-list-to-another-using-JOLT/m-p/390982#M247421</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-07-25T17:53:07Z</dc:date>
    </item>
  </channel>
</rss>

