Tagged: parent child custom parameter
This topic contains 7 replies, has 0 voices, and was last updated by Anonymous 8 years, 1 month ago.
- September 23, 2010 at 1:07 pm #573
I have a very simple parent form containing a table in which one column contains email addresses (at the moment only one email address). My Show Form behaviour opens up a child form and I want to get the email address into the child form so that I can use it to send a notification. In the Show Form behaviour in the parent form I have set the table column to be a Custom Parameter, and in the child form I am trying to do a set field formula when the page opens to pick up the email address from the parent. The formula I’m choosing here is Get Custom Parameter. But I am not sure how I “get” the parameter in question…. Nothing I try has worked so far. Any ideas? I am probably doing something very simple incorrectly!!
Ah… I think the trouble is with my table. I managed to do it from a field outside the table.September 24, 2010 at 12:20 am #5438
If I have a table in a parent from which I am extracting custom parameters, I like to use a helper field to temporarily hold that value (in your case, the email address). You can make it a hidden field if you want.
When you start the behavior use a set table object to move the current row of the table to the first row. Then set your new field with the value in the current row of the table, then bring in your show form object to create your child (using the value in the new field as your custom parameter). From here you need to create a looping behavior to make sure that you create a child for every row in your table. Use a set table row and move the current row to the next row. Then use a simple branch with the advanced condition (special – last command was successful). If true, loop back to your set field. If false, end the behavior. This behavior will launch a child instance for every row in the table.
I will add another bit of advice: If you want the child to simply open, grab the custom parameter, close, and send a notification, use a hidden helper field in the child. Create a behavior on when the form opens. Start with a simple branch – is the hidden field empty? If true, then set the hidden field with a 1 (or any other value), set the email field with the custom parameter, and submit the form (closing the browser window). When the user clicks the link in the notification to access their form instance there will be a value in the hidden field so the instance will remain open for them!September 27, 2010 at 10:38 am #5441
Hi Dennis – this was really helpful. I have got as far as your “another bit of advice”. I have created the behaviour that you describe, in “Form Opens” in the child. (Is there a False response to the simple branch? I don’t think so…)
My child forms show correctly with the email address in place (I’ll hide the field in due course..) Can you advise me where to build the notification behaviour? I have currently got it in “page is opened” in the child, but it isn’t working… Also, should it be child opens, notification is sent, child closes, or child opens, child closes, notification is sent? Or doesn’t it matter? What is the difference between the showing of the form (behaviour in the parent) and the user opening the form from the email notification – I mean, should I be doing the notification in the behaviour in the parent? (I think I may be answering my own question as I write it….! But would welcome your advice.)September 27, 2010 at 3:24 pm #5442
I’m glad you asked the question. We find the best practice for notifications is to set them in the work flow. In the join paths between work flow stages you can create behaviors. This is where I place notifications. In your scenario, between stages 1 and 2. Use the condition “always if no other condition is met”, so when the form opens and closes it automatically moves from stage 1 to stage 2. When is closes it will send the notification(s) (assuming that you have set them).
Part two of your question: When the parent runs the show form behavior, it is creating a new instance of your child form. When the child form sends a notification to the user, the link in that notification will bring the user back to the same instance of the form. It is a unique instance of that form. This is the fact that gives you the ability to track your users individually. Your child form can be built to send back up notifications until the instance is completed. You can build a report to show you from a high level or granular level what progress your users have made towards completing their form instances.September 28, 2010 at 10:46 am #5443
I have created a workflow in my child form where stage one is a default stage, and stage 2 is when the form closes (but I haven’t made it a Closed stage – should I? – there is more to follow, when the recipient completes and submits from the notification) On the join path I have created a notification as you have described. The notification takes the email address from a field that is set in the behaviour when the form opens. I know this behaviour works. However, the notification email isn’t working. I wondered about the email settings (server) but I have made email notifications work in other forms by leaving it as “default” so I don’t think that is the problem.
Also re your help: “I will add another bit of advice: If you want the child to simply open, grab the custom parameter, close, and send a notification, use a hidden helper field in the child. Create a behavior on when the form opens. Start with a simple branch – is the hidden field empty? If true, then set the hidden field with a 1 (or any other value), set the email field with the custom parameter, and submit the form (closing the browser window). When the user clicks the link in the notification to access their form instance there will be a value in the hidden field so the instance will remain open for them! ” – how can I submit the form here when it is full of mandatory fields that the user has to complete? If a child form opens, has fields set in it, and then closes, what happens to it? Does it have to open, have fields set in it, and be submitted in some way or other? I’m lost!September 28, 2010 at 5:11 pm #5444
It sounds like you have at least 3 stages: New (when it opens, grabs the custom parameters and closes), stage 2 when the user accesses it via the link, and stage 3 (closed). You should make the last stage a closed stage. If this is a long survey, you may also want to give your user the option of saving and returning later which would involve more stages.
I cannot diagnose why your notifications are not sending without seeing the .pf file for your form.
With regard to mandatory fields I find best practice to be using a check mandatory behavior object rather than the mandatory check box for each object on the page. Instead of using a submit button (or a page button) use a regular button and change the caption to next or submit. On “button is pressed” use a check mandatory object and then submit or show next page. This way your form can submit under one behavior without concern form mandatory objects in another behavior. The other advantage is that on a multiple page form, your users will not get to the end before finding out that they missed fields way back on page 1.September 29, 2010 at 9:00 am #5445
Thank you Dennis – I have made significant progress!! I fixed the mandatory fields issues and now each child form is successfully submitted immediately after creation, in an Open state. Initial email notifications go out correctly. However, only the notification sent to the first email address in the list contains a link that will stay open when clicked – (it can then be completed and when submitted again goes to a Closed state). I created a hidden “helper” field in the “Form is Opened” behaviour as you suggested earlier, and I have checked that for each of my child forms (open or closed state) the field does contain a value, which should mean that the form stays open when accessed from the notification. Any ideas? I’ve checked everything I can think of.September 29, 2010 at 4:13 pm #5446
It sounds like you have a behavior that is clearing your hidden field. I will send you my email address so you can send me a copy of the PF file for your child form. I can take a look at it if you like.
You must be logged in to reply to this topic.