DictionaryToJson

<< Fare clic per visualizzazione il sommario >>

Percorso:  API di piattaforma > Altri servizi > Rest >

DictionaryToJson

Service

Rest

 

Method

DictionaryToJson

 

Description

Converts a dataset to a string containing the equivalent Json.

 

Input

Name

Description

Type

Optional

dictionary

Dataset to convert

Dataset

 

dictionaryFieldNames

A list containing the names of the dictionary keys corresponding to the field names specified in the jsonFieldNames list; a null or empty list implies that the keys in the dataset will be used as field names in the returned Json structure.

List of string

 

jsonFieldNames

A list containing the names of fields (regardless of the level) mapped in the corresponding fields specified in the dictionaryFieldNames list; a null or empty list implies that the dataset keys will be used as field names in the returned Json structure.

List of string

 

Output

Name

Description

Type

Optional

returnValue

A string containing the dataset in Json format.

String

 

 

Remarks

This function can help constructing data for POST or PUT invocations that require Json format. The dictionaryFieldNames and jsonFieldNames lists must have the same number of elements.

As an example, if dictionaryFieldNames[0] = “PageNumber” and jsonFieldNames[0] = “pageid”, the “PageNumber” field in the dataset will be returned as the “pageid” field in the returned Json structure;

fields not present in the dictionaryFieldNames list will retain their names in the returned Json structure.