Drupal Add Field Collection with mutli-value field with web services

72 Views Asked by At

i am trying to create a node that have a field collection with multi-values, but this only save the first value and the second not.

I am trying in the following way:

"field_mobile_number_collection" : {
            "und" : [
                           {
                "field_mobile_number" : {
                    "und" : [{
                        "value" : "123456789"
                    }]
                },
                "field_privacy_options" : {
                    "und" : "1"
                }
            }, {
                "field_mobile_number" : {
                    "und" : [{
                        "value" : "234232342343"
                    }]
                },
                "field_privacy_options" : {
                    "und" : "0"
                }
            }]
        }

Thank you very much for your help.

1

There are 1 best solutions below

0
On

Did you try something like :

"field_mobile_number_collection" : [{
            "und" : [{
                "field_mobile_number" : {
                    "und" : [{
                        "value" : "123456789"
                    }]
                },
                "field_privacy_options" : {
                    "und" : "1"
                }
            }],
            "und" : [{
                "field_mobile_number" : {
                    "und" : [{
                        "value" : "234232342343"
                    }]
                },
                "field_privacy_options" : {
                    "und" : "0"
                }
            }]
        }]