How to submit a field collection from a form into a created node I would really appreciate if somebody could help me with this :)
 

I have a field collection called field_formations. Inside it I have 2 fields:


field_technologies - (reference to a taxonomy).
field_diploma -(how it's also a field collection which contain 2 other   fields:
field_name(reference to a taxonomy)
field_establishement (text plain)
               ).

I've created a form with 3 field forms
technology
diplome_name
establishement

and into the submit form i would like to submit values of this forms into  the node created at first.

I tried to setValues like this :


$node->field_formations->field_technologies->setValue($values['technology']);

but it dosen't work 
Can any body have a suggetion??
 
PS : I'm using drupal 8
You need the id of the field collection item (grand one) which you can find inside the node object. Then you load the field collection by that id as an entity. Edit this field collection and save it as an entity. The point is that you have to load the field collectin entity, make changes and save it.