How do I pass data between Parent and Subform?

Follow

Comments

15 comments

  • Avatar
    Simon Wessberg

    Is this only possible with Text and Number widgets?

  • Avatar
    bwilcox02

    I am unable to pass Date-Time values to a subform in this way.

  • Avatar
    Tony Ruth

    @ Simon, you can pass other data points around, just not media

    @ Ben, please make sure you constructed the function properly to display the variable being passed in

  • Avatar
    Emma

    Tony, I am having the same problem as Ben passing a date. I tried doing it as a number and as text, no dice.

  • Avatar
    eric lund

    Also, I can pass a pick list value from parent to child form provided both elements are pick list type, however a pick list type then does not have a read only option. The result (in addition to the undesired potential to change the sub form value) is that it now appears on sub-form as a field rather than a text only value. It would be nice if all values passed to sub-form appear there in consistent format i.e. read only text.

  • Avatar
    Mel Nottley

    Any Solution for passing Date-Time?

  • Avatar
    Tony Ruth

    Hi Mel, yes you can use the Date() javascript function to pass this information around

  • Avatar
    Karl Simms
    Hi Guys, firstly let me apologise for re-opening such a old post, but i have trouble with the date fields, If i have a parent field called date_of_startup1 and want aanother date field to pull that said date down, the dynamic value should be {date_of_signup1}. what ive noticed that even though theres no newDate() function on the second field, its always poplulated with todays date. im stuck as hell and cant figure out whats happening. the only thing i can presume is that its getting the newDate() value from the first field but not correctly updating? anyone got any ideas?
  • Avatar
    Darius
    I think I followed these instructions I'm trying to pass data from a subform to a parent using your example above. The parent form "2015_ffh_eval" has a text element called "job_name" the subform element "appdata" has an text field called "last_name" the dynamic value in my parent form is: "2015_ffh_eval.appdata[0].last_name" The dynamic value in the subform element is: last_name="" This is not working, where am I going wrong?
  • Avatar
    David Pyle

    Hi Guys,
    I had an issue where I wanted to put the value of a Date/Time widget from a subform into a Text widget on the parent form.

    Subform Date/Time Widget: datetime
    Parent Text Widget: theDate

    If you set the dynamic value field of 'theDate' to 'datetime' nothing is displayed. However, if you set it to 'datetime.toString()' the date from the subform appears in the text widget. This solved my particular problem as I just wanted to check that a date was entered on the subform.

    toString() is a built-in Javascript method. In this case it converts a Date object into a string.

    Thought I'd post this in case others had a similar issue.

  • Avatar
    Darius

    Passing from 1st or 3rd level child forms works. New Challenge: want to pass data from a 3rd level subform back to the 2nd level subform, can't seem to get this to work

  • Avatar
    Darius

    I can pass the data back to the parent from the 2nd level subform so the example above works. A work around is to them pass from the parent back down to the 1st level subform. Just seems like there is an easier way.

  • Avatar
    Dave Rebot

    https://iformbuilder.zendesk.com/hc/en-us/articles/201697700/comments/207090863
    Has this problem been resolved? I am experiencing the same issue.
    I can pull data from a 3rd level form to the 1st level parent form. But I am unable to pull data from a 3rd level form to a 2nd level form.

  • Avatar
    Tony Ruth (Edited )

    Hey Dave, I attached a form package to the bottom of the article which pulls data from the third level back to the second. Here is a link to the package directly.


    https://iformbuilder.zendesk.com/hc/en-us/article_attachments/115003026366/Package_Third_Level_back_to_Second.json

    Hope that helps!

  • Avatar
    Darius

    Thanks Tony will give this a look

Please sign in to leave a comment.

Powered by Zendesk