UiPath Documentation
activities
latest
false
Important :
Veuillez noter que ce contenu a été localisé en partie à l’aide de la traduction automatique. La localisation du contenu nouvellement publié peut prendre 1 à 2 semaines avant d’être disponible.
UiPath logo, featuring letters U and I in white

Activités du développeur.

Dernière mise à jour 21 avr. 2026

Deserialize JSON

UiPath.WebAPI.Activities.DeserializeJson

Description

Désérialise la chaîne ou l'exemple JSON en un JObject.

Compatibilité du projet

Windows - Héritage | Windows | Multiplate-forme

Windows, configuration multiplate-forme

  • JSON String - The string containing the JSON to be deserialized. The JSON should be written without indents, and between double quotes. Strings inside the JSON should be written with single quotes. For example, the following JSON is valid: "{'TenancyName': 'Documentation', 'UsernameOrEmail': 'Documentation', 'Password': 'Documentation'}".
  • JSON Sample - The JSON sample for the output structure. The activitiy converts this sample into a similar object which you can use during design time.
Options avancées
Entrée
  • Input Type - A dropdown list that enables you to select the argument type of the object to deserialize.
    Remarque :

    In Studio Web, parsing the sample object via the JSON Sample property makes the Input Type property read-only.

Sortie

Configuration Windows - Héritage

Panneau propriétés

Commun

  • NomAffichage (DisplayName) - Nom affiché de l'activité.

Entrée

  • JSON Sample - The JSON sample for the output structure. The activitiy converts this sample into a similar object which you can use during design time.
  • JsonString - The string containing the JSON to be deserialized. Write the JSON without indents, and between double quotes. Strings inside the JSON should be written with single quotes. For example, the following JSON is valid: "{'TenancyName': 'Documentation', 'UsernameOrEmail': 'Documentation', 'Password': 'Documentation'}".

Divers

  • Privé (Private) - Si cette option est sélectionnée, les valeurs des variables et des arguments ne sont plus enregistrées au niveau Détaillé (Verbose).
  • TypeArgument - A drop-down list that enables you to select the type of output returned. The provided JSON string will be converted to an object of the selected type.

Sortie

Exemple d’utilisation de l’activité Deserialize Json

The Deserialize Json activity is used for extracting data from JSON files and strings.

To exemplify how to use this activity, we have created an example that uses the Deserialize Json activity for extracting the age of a person from a JSON file.

Voici comment le processus d'automatisation peut être créé :

  1. Ouvrez Studio et démarrez un nouveau Processus.
  2. Drag a Sequence to the Workflow Designer.
    • Créez les variables suivantes :

      Nom de variableTypes de variablesValeur par défaut
      JsonTextChaîne de caractères (string)
      JsonObjObjetJ
      AgeValeurGénérique
  3. Drag a Read Text File activity inside the sequence container.
    • In the Properties panel, add the value "JsonString.txt" in the FileName field.
    • Add the variable JsonText in the Content field.
  4. Add a Deserialize JSON activity after the Read Text File activity.
    • In the Properties panel, add the variable JsonText in the JsonString field and the variable JsonObj in the JsonObject field.
    • Select the value Newtonsoft.Json.Linq.JObject from the TypeArgument drop-down list.
  5. Place an Assign activity under the Deserialize JSON activity.
    • Add the variable Age in the To field and the expression JsonObj.SelectToken("age").ToString in the Value field.
  6. Drag a Write Line activity after the Assign activity.
    • Ajoutez la variable Age dans le champ Texte.
  7. Run the process. The robot extracts the age value from the .json file and displays it in the Output panel.

Ici, vous pouvez télécharger un exemple.

Cette page vous a-t-elle été utile ?

Connecter

Besoin d'aide ? Assistance

Vous souhaitez apprendre ? UiPath Academy

Vous avez des questions ? UiPath Forum

Rester à jour