title: Json values from one file, based on fields from another Json file
body: <p>I am trying to get values to a JSON file, based on field mapping from another JSON file.
  I have a JSON file I get from external systems, which have different field names. I created a JSON file that will map the fields from the external system to the names I need the fields to be in:</p>
  <pre><code>{
      &quot;username&quot;:&quot;user&quot;,
      &quot;externalSystemId&quot;:&quot;id&quot;,
      &quot;active&quot;:&quot;active&quot;,
      &quot;type&quot;:&quot;type&quot;,
      &quot;patronGroup&quot;:&quot;group&quot;,
      &quot;meta&quot;: {
          &quot;creation_date&quot;:&quot;dateCreated&quot;,
          &quot;last_login_date&quot;:&quot;lastLogin&quot;
      },
      &quot;personal&quot;: {
          &quot;lastName&quot;:&quot;lname&quot;,
          &quot;firstName&quot;:&quot;fname&quot;,
          &quot;email&quot;:&quot;email&quot;,
          &quot;phone&quot;:&quot;phone&quot;,
          &quot;mobilePhone&quot;:&quot;mobile&quot;,
          &quot;dateOfBirth&quot;:&quot;birthDate&quot;,
          &quot;addresses&quot;:{
                  &quot;countryId&quot;: &quot;countryCode&quot;,
                  &quot;addressLine1&quot;: &quot;address&quot;,
                  &quot;addressLine2&quot;: &quot;address2&quot;,
                  &quot;city&quot;: &quot;city&quot;,
                  &quot;region&quot;: &quot;region&quot;,
                  &quot;postalCode&quot;: &quot;zipcode&quot;,
                  &quot;addressTypeId&quot;: &quot;addressType&quot;,
                  &quot;primaryAddress&quot;: &quot;primary&quot;
          }
      },
      &quot;enrollmentDate&quot;: &quot;enrollmentDate&quot;,
      &quot;expirationDate&quot;: &quot;expirationDate&quot;
  }
  </code></pre>
  <p>In this file, the fields are the fields I will need to populate, while the values are the names of the fields I get from the external system, which looks like this for example:</p>
  <pre><code>{
      &quot;user&quot;:&quot;name&quot;,
      &quot;id&quot;:12345,
      &quot;active&quot;:true,
      &quot;type&quot;:&quot;Student&quot;,
      &quot;group&quot;:&quot;BA&quot;,
      &quot;dateCreated&quot;:&quot;NOV 22 2019&quot;,
      &quot;lastLogin&quot;:&quot;NOV 23 2020&quot;,
      &quot;lname&quot;:&quot;Yard&quot;,
      &quot;fname&quot;:&quot;Paul&quot;,
      &quot;email&quot;:&quot;email@gmail.com&quot;,
      &quot;phone&quot;:&quot;(000)-000-0000&quot;,
      &quot;mobile&quot;:&quot;(000)-000-0000&quot;,
      &quot;birthDate&quot;:&quot;OCT 11 1999&quot;,
      &quot;countryId&quot;: &quot;US&quot;,
      &quot;addressLine1&quot;: &quot;4th street&quot;,
      &quot;addressLine2&quot;: &quot;25B&quot;,
      &quot;city&quot;: &quot;NY&quot;,
      &quot;region&quot;: &quot;NY&quot;,
      &quot;postalCode&quot;: &quot;00000&quot;,
      &quot;addressTypeId&quot;: &quot;Personal&quot;,
      &quot;primaryAddress&quot;: true,
      &quot;enrollmentDate&quot;: &quot;MAR 22 2019&quot;,
      &quot;expirationDate&quot;: &quot;MAR 21 2022&quot;
  }
  </code></pre>
  <p>So the end JSON file will need to look like this:</p>
  <pre><code>{
      &quot;username&quot;:&quot;name&quot;,
      &quot;externalSystemId&quot;:12345,
      &quot;active&quot;:true,
      &quot;type&quot;:&quot;Student&quot;,
      &quot;patronGroup&quot;:&quot;BA&quot;,
      &quot;meta&quot;: {
          &quot;creation_date&quot;:&quot;NOV 22 2019&quot;,
          &quot;last_login_date&quot;:&quot;NOV 23 2020&quot;
      },
      &quot;personal&quot;: {
          &quot;lastName&quot;:&quot;Yard&quot;,
          &quot;firstName&quot;:&quot;Paul&quot;,
          &quot;email&quot;:&quot;email@gmail.com&quot;,
          &quot;phone&quot;:&quot;(000)-000-0000&quot;,
          &quot;mobilePhone&quot;:&quot;(000)-000-0000&quot;,
          &quot;dateOfBirth&quot;:&quot;OCT 11 1999&quot;,
          &quot;addresses&quot;:{
              &quot;countryId&quot;: &quot;US&quot;,
              &quot;addressLine1&quot;: &quot;4th street&quot;,
              &quot;addressLine2&quot;: &quot;25B&quot;,
              &quot;city&quot;: &quot;NY&quot;,
              &quot;region&quot;: &quot;NY&quot;,
              &quot;postalCode&quot;: &quot;00000&quot;,
              &quot;addressTypeId&quot;: &quot;Personal&quot;,
              &quot;primaryAddress&quot;: true
          }
      },
      &quot;enrollmentDate&quot;: &quot;MAR 22 2019&quot;,
      &quot;expirationDate&quot;: &quot;MAR 21 2022&quot;
  }
  </code></pre>
  <p>I was thinking of using a dictionary/index to create this, but I've never done that before, nor am I sure how to do it.
  Is there a simple way to do it?</p>