4D v16.3JSON TO SELECTION |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
JSON TO SELECTION
JSON TO SELECTION
The JSON TO SELECTION command copies the contents of an array of JSON objects jsonArray to the selection of records of aTable. The jsonArray parameter is a text representing an array of objects formatted in JSON and containing one or more elements. The expected syntax is of the type: "[{"attribute1":"value1","attribute2":"value2",...},...,{"attribute1":"valueN","attribute2":"valueN",...}]" If a selection exists for aTable at the time of the call, the elements of the JSON array are copied into the records based on the order of the array and the order of the records. If the number of elements defined in the JSON array is greater than the number of records in the current selection, new records are created. The records, whether they are new or existing, are automatically saved. Note: This command supports Object type fields: JSON data is converted automatically. Warning: Since JSON TO SELECTION replaces any information found in the existing records, this command must be used with caution. If a record is locked by another process during the execution of the command, it is not modified. All the locked records are placed in the The LockedSet System Set. After the execution of JSON TO SELECTION, you can test whether the LockedSet set contains any records that were locked. Using the JSON TO SELECTION command to add records to the [Company] table: C_OBJECT($Object1;$Object2;$Object3;$Object4)
See also
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v14 ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||