• Charles Kelly 17
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello,

I am trying to import a json file into my salesforce org using VS Code. The source file has different field names than my org so I need to do some field mapping. Here is the file I'm using:
{
    "orgPreferences": {
      "objectSettings": [
        {
          "object": "Player__c",
          "type": "object",
          "files": ["PlayerList2.json"],
          "resolveRefs": true,
          "saveRefs": true,
          "fieldMappings": [
            {
              "source": "amateur",
              "target": "Amateur__c"
            },
            {
              "source": "country",
              "target": "Country__c"
            },
            {
              "source": "country_code",
              "target": "country_code__c"
            },
            {
              "source": "dg_id",
              "target": "dg_id__c"
            },
            {
              "source": "player_name",
              "target": "Name"
            }
          ]
        }
      ]
    }
  }

However, I keep getting the error: 

Error (1): Validation errors:
#/type: must be array

I've tried adding [] around "Object" but still getting the same error.

Please help!
Thanks
Charles
Hello,

I'm trying to insert the below json into a custom object named Player. I need to change the field names from amateur to amater__c and country to country__c etc. How can I do this at scale?

Also, it works if I insert one record at a time but gives the error below when there is multiple records trying to be inserted. 

Thank you

User-added image
Hello,

I'm trying to insert the below json into a custom object named Player. I need to change the field names from amateur to amater__c and country to country__c etc. How can I do this at scale?

Also, it works if I insert one record at a time but gives the error below when there is multiple records trying to be inserted. 

Thank you

User-added image