ExamGecko
Question list
Search
Search

Question 123 - Certified B2B Commerce Developer discussion

Report
Export

A developer needs to import some new product data contained in a JSON file one time. What are two viable ways to do this? .

A.
Convert the JSON to an xlsx file and use Workbench to import it
Answers
A.
Convert the JSON to an xlsx file and use Workbench to import it
B.
Run a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username>
Answers
B.
Run a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username>
C.
Convert the JSON to a CSV file and use Data Loader to import it
Answers
C.
Convert the JSON to a CSV file and use Data Loader to import it
D.
Run a command like: sfdx force:data;import:bulk -f NewProducts.json -u <your username>
Answers
D.
Run a command like: sfdx force:data;import:bulk -f NewProducts.json -u <your username>
Suggested answer: B, C

Explanation:

Two viable ways that a developer can import some new product data contained in a JSON file one time are running a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username> and converting the JSON to a CSV file and using Data Loader to import it. Running a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username> allows the developer to import data from a JSON file into an org using Salesforce CLI commands. The sfdx force:data:tree:import command is a Salesforce CLI command that imports data into an org using JSON files that conform to the SObject Tree API specification. The SObject Tree API specification is a format that defines how records are represented in JSON files for data import or export. The -f flag specifies the path of the JSON file that contains the data to be imported. The -u flag specifies the username or alias of the org where the data will be imported. Running this command will create records in the org based on the data in the JSON file. Converting the JSON to a CSV file and using Data Loader to import it allows the developer to import data from a CSV file into an org using Data Loader. Data Loader is a tool that allows users to import or export data between Salesforce and CSV files. The developer can use an online converter or a spreadsheet application to convert their JSON file into a CSV file that matches the structure and format of their Salesforce object. The developer can then use Data Loader to import the CSV file into their org and create records based on the data in the CSV file. Converting the JSON to an xlsx file and using Workbench to import it is not a viable way to import some new product data contained in a JSON file one time, as Workbench does not support xlsx files for data import or export. Workbench is a web-based tool that provides access to various Salesforce features and functionalities, such as data manipulation, REST Explorer, and Apex Execute. Running a command like: sfdx force:data;import:bulk -f NewProducts.json -u <your username> is not a viable way either, as there is no such command as sfdx force:data;import:bulk. The correct command for importing data using bulk API is sfdx force:data:bulk:upsert. Salesforce

Reference: [Salesforce CLI Command Reference: force:data:tree:import], [Salesforce Developer Tools for Visual Studio Code], [Data Loader Guide: Import Data into Salesforce], [Workbench], [Salesforce CLI Command Reference: force:data:bulk:upsert]

asked 23/09/2024
Higinia Silva
28 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first