Answers.Body: <p>The option of creating a rule is a probably an easy solution. There is a Drupal module to have a tirgger in civirules when a webform is submitted (<a href="https://lab.civicrm.org/partners/civicoop/webform_civirules" rel="nofollow noreferrer">https://lab.civicrm.org/partners/civicoop/webform_civirules</a>) </p>
  
  <p>Why do you want to store the information twice in your system and only ask once? </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-27T13:13:32.417Z
Answers.Text: Thank you all for your suggestions ; I finally opted for the webform Conditional as suggested by Jitendra (and which I did not think of before) : I set the Child field value (textfield) according to the Parent field selected value (select field) : it is a bit heavy to implement (several values and several children in the webform), but it has the advantage to have all in one webform : easier to test and maintain. But I would be pleased to validate all the proposed solutions.
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-27T13:18:37.713Z
Answers.Text: Jaap : I need to store the info related to each participant because the information belongs to all the related participants : Parent AND children : if I question a child, I want to get the information. + using Views, I did not find a way to display a custom field from a related participant : see https://civicrm.stackexchange.com/questions/26267/how-to-display-a-related-contacts-participant-custom-field-in-a-view
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-29T08:17:19.027Z
Answers.Text: Ah I see. So the reason for storing it multiple times is because it is hard to show them in a view. Understandable. I have also commented on your other topic.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-25T19:17:32.570Z
Answers.Text: Jacques would be good for you to add your own Answer and Accept it so this Q has an answer
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-27T09:25:35.880Z
Answers.LastActivityDate: 2018-08-27T09:25:35.880Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>I use a Webform to register both Parent and related Children to an Event.</p>
  
  <p>I would like them to <strong>share</strong> a common Participant Custom Field information : this does not seem possible, since each Participant has his own.</p>
  
  <p>I think of different options, but I don't know if they are possible :</p>
  
  <p><strong>Option 1 :</strong> in the Webform : set Child field i to Parent field j Value : but, as far as I know, this is not possible with the standard Webform Conditionals ; is there any Webform extension to do that ?</p>
  
  <p><strong>Option 2 :</strong> independantly from Webform : create a Rule (?) (and a CRON Job ?) to copy Parent field j Value to his related Children's fields i. But I don't know wether this is possible, nor how to do that.</p>
  
  <p>Any help or suggestion is welcome (I am not a developper)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-26T10:38:03.503Z
Comments.Text: Can you use registered by participant? I mean have custom field for Parent and then create a participant for child and link to parent participant ID.
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-26T16:17:26.650Z
Comments.Text: As far as I understand what you mean, it is what I do : One Webform to register Parent AND children, with "Register each Contact separately" method + Particpant custom field for Parent + relationship to Parent for each Child. I want Children to share (or copy) the Parent Participant Custom Field.
Comments.UserDisplayName: Jacques-Marie Moranne
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-26T18:02:49.880Z
Comments.Text: I don't think this something easily doable through UI configuration. But do possible by writing a extension or module. Wait for someone in the community to answer or provide any other solutions
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-27T03:06:23.720Z
Comments.Text: Is your participant custom field a select element? If yes, maybe add webform conditional for all the options present. If not, you might need to add a markup field and add a small js to copy the value from one field to another.
Comments.UserDisplayName: jitendra - fuzion
Tags: <webform-civicrm><civirules>
Title: How to copy a Custom Field in a related Contact's Custom Field?
ThreadText: # How to copy a Custom Field in a related Contact's Custom Field?
  
  (Asked by: username_0 on 2018-08-26)
  
  I use a Webform to register both Parent and related Children to an Event.
  
  I would like them to **share** a common Participant Custom Field information : this does not seem possible, since each Participant has his own.
  
  I think of different options, but I don't know if they are possible :
  
  **Option 1 :** in the Webform : set Child field i to Parent field j Value : but, as far as I know, this is not possible with the standard Webform Conditionals ; is there any Webform extension to do that ?
  
  **Option 2 :** independantly from Webform : create a Rule (?) (and a CRON Job ?) to copy Parent field j Value to his related Children's fields i. But I don't know wether this is possible, nor how to do that.
  
  Any help or suggestion is welcome (I am not a developper)
  
  **Tags:** webform-civicrm, civirules
  
  > **Comments:**
  > **username_1**: Can you use registered by participant? I mean have custom field for Parent and then create a participant for child and link to parent participant ID.  
  > **username_0**: As far as I understand what you mean, it is what I do : One Webform to register Parent AND children, with "Register each Contact separately" method + Particpant custom field for Parent + relationship to Parent for each Child. I want Children to share (or copy) the Parent Participant Custom Field.  
  > **username_1**: I don't think this something easily doable through UI configuration. But do possible by writing a extension or module. Wait for someone in the community to answer or provide any other solutions  
  > **username_2**: Is your participant custom field a select element? If yes, maybe add webform conditional for all the options present. If not, you might need to add a markup field and add a small js to copy the value from one field to another.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-08-27. Score: 0
  
  The option of creating a rule is a probably an easy solution. There is a Drupal module to have a tirgger in civirules when a webform is submitted (<https://lab.civicrm.org/partners/civicoop/webform_civirules>)
  
  Why do you want to store the information twice in your system and only ask once?
  
  > **Comments:**
  > **username_0**: Thank you all for your suggestions ; I finally opted for the webform Conditional as suggested by Jitendra (and which I did not think of before) : I set the Child field value (textfield) according to the Parent field selected value (select field) : it is a bit heavy to implement (several values and several children in the webform), but it has the advantage to have all in one webform : easier to test and maintain. But I would be pleased to validate all the proposed solutions.  
  > **username_0**: Jaap : I need to store the info related to each participant because the information belongs to all the related participants : Parent AND children : if I question a child, I want to get the information. + using Views, I did not find a way to display a custom field from a related participant : see https://civicrm.stackexchange.com/questions/26267/how-to-display-a-related-contacts-participant-custom-field-in-a-view  
  > **username_3**: Ah I see. So the reason for storing it multiple times is because it is hard to show them in a view. Understandable. I have also commented on your other topic.  
  > **username_4**: Jacques would be good for you to add your own Answer and Accept it so this Q has an answer  
  
  ---
  
  