titobrasolin / Drupal7.Services

.NET API to integrate with Drupal 7 via Services 3 module.
MIT License
7 stars 3 forks source link

Create Node with multi value fields #11

Closed ach00 closed 8 years ago

ach00 commented 8 years ago

Hi, I would like to create a node that contains an array of data. The node is created correctly but only the first item of the array is being added to the node.

Here is my code, only the first "target_id" is created:

var node = new Hashtable
            {
                { "type", "step" },
                { "title", "title" },
                { "language", "en" },
                { "field_content_reference", new Hashtable
                    {
                        { "und",  new Object[3] 
                            {
                                new XmlRpcStruct
                                {
                                    { "target_id", "Visibilite conso content (996)"} ,
                                },
                                new XmlRpcStruct
                                {
                                    { "target_id", "Visibilite conso (997)"}
                                },
                                new XmlRpcStruct
                                {
                                    { "target_id", "Visibilite conso (267)"}
                                }
                            }
                        }
                    }
                }

            };
            var nid = drupal.NodeCreate(node);

Can you please help me with this? Thanks