The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Share a form entry between users
NOTE: There is an updated version of this guide HERE
Hi All
Last year i came up against a problem whist building a form in Formidable and i thought the solution may be useful for other people so i’m posting it here incase anyone wants to achieve the same result.
The problem: We built a form for our clients to complete when they need to book in very large and complex jobs at various times throughout the year. The form is so large that they often need to save drafts and come back later to complete the order. The problem comes when different members of staff would like to log in and carry on where someone else left off or, after the form has been submitted, edit the submitted entry with some new information or updated requirements.
So, i spent some time trying to figure out how this could be achieved.
The Solution:
The solution to this problem requires a few things before you start:
- Users must be logged in when they complete the form for this to work.
- You need to be able to group your users using a shared field in their profiles. We use the WP-Client Plugin to manage our customers and created a custom field which is used in each user profile but it can be done using the standard WordPress profile fields like the Nickname or Display Name field if they’re not already in use. If they are already being used you can use one of the many available plugins for adding additional fields to user profiles.
- Formidable Pro as you will require Views and a few other features.
So the first stage is to group your user together by Company Name so they can all access the same form results. The easiest way to do this using the default WordPress user profile fields is to use the Nickname field and enter the Company Name in there.
SEE SCREENSHOT BELOW
You will need to do this for each user profile and they will all need to be identical. For example Company A might have 6 users on your site. The Nickname field for all 6 of these users will all need to contain Company A. Repeat the process for each company or group of users.
The 2nd stage is to build your form and your questions. There’s nothing special to do here but a few things you can do to make life a little easier later one:
- Add a Field and call it “Client ID” or "Company Name" or whatever you want. You can either make this field Read only to stop your users trying to edit it and messing up the system or just use a Hidden field.
- Put a default value in this field for your Company Name filed in the user profile. The “User Meta” shortcode is perfect for this if you have a custom field created or you if you're using the Display name field you can just use the [display_name] shortcode. For example i have a field in each user profile called wpc_cf_organisationname so i use the user meta shortcode and my shortcode looks like this: [user_meta key=wpc_cf_organisationname]
SEE SCREENSHOT BELOW
Once you’ve built your form you need to go to the “settings” part of your form and choose some options here too to make sure the form is locked down enough to the right users but still editable.
Basically all you need to do is edit the Permissions section of the form settings and select all of the avilable options and set them all to "Logged-in Users"
SEE SCREENSHOT BELOW
So now the form has been created and the settings configured, we now need to build a view to display the results.
The view Basic Settings should be as follows:
- Use Entries from Form: The form you have just created
- View Format: Both (Dynamic)
Then on the Listing Page tab here’s what i’ve used (feel free to edit this to whatever you want, this just works for me):
Before Content: Nothing
Content:
<strong>Client Questionnaire.</strong> <ul> <li>Created: [created-at]</li> <li>Created By: [2345] [2346]</li> <li>Last Updated: [updated-at]</li> <li>Updated By: [updated-by]</li> </ul> [dt_gap height="20" /] <span class="vc_btn3-container wpb_animate_when_almost_visible wpb_appear vc_btn3-inline wpb_start_animation"><a class="vc_general vc_btn3 vc_btn3-size-md vc_btn3-shape-square vc_btn3-style-outline vc_btn3-icon-left vc_btn3-color-inverse" title="" href="[detaillink]" target="_self"><i class="vc_btn3-icon fa fa-search"></i> View This Entry</a></span> <span class="vc_btn3-container wpb_animate_when_almost_visible wpb_appear vc_btn3-inline wpb_start_animation">[editlink class="vc_general vc_btn3 vc_btn3-size-md vc_btn3-shape-square vc_btn3-style-outline vc_btn3-color-inverse" location="front" label="Edit This Entry" page_id=13677]</span>
The Details Page tab contains this code (very similar but with a different title & button at the bottom):
<h3>Submission details</h3> <ul> <li>Created: [created-at]</li> <li>Created By: [2345] [2346]</li> <li>Last Updated: [updated-at]</li> <li>Updated By: [updated-by]</li> </ul> [dt_gap height="20" /] <span class="vc_btn3-container wpb_animate_when_almost_visible wpb_appear vc_btn3-inline wpb_start_animation"><a class="vc_general vc_btn3 vc_btn3-size-md vc_btn3-shape-square vc_btn3-style-outline vc_btn3-icon-left vc_btn3-color-inverse" title="" href="https://www.fdmplc.com/portal-2/referendum-2016/" target="_self"><i class="vc_btn3-icon fa icon-back"></i> Go Back</a></span> <span class="vc_btn3-container wpb_animate_when_almost_visible wpb_appear vc_btn3-inline wpb_start_animation">[editlink class="vc_general vc_btn3 vc_btn3-size-md vc_btn3-shape-square vc_btn3-style-outline vc_btn3-color-inverse" location="front" label="Edit This Entry" page_id=13677]</span>
They key components of both of these pages are:
- The use of the [updated-by] and [updated-at] shortcodes allow our users to see which if their colleagues last edited and updated the form.
- The Created By: section uses the first name and last name fields from our form
- The 2 buttons under the list use the Formidable shortcodes [detaillink] and [editlink] as the URL’s which need to be configured correctly for them to work. The full articles on how to do that can be found here: https://formidableforms.com/knowledgebase/set-up-front-end-editing/
You then need to configure the Advanced Settings at the bottom of your View page.
In the Sort & Filter section add a Filter Entries rule that looks like this:
Filter Entries > Your Company Name Field > is Equal To > [display_name] or whatever User Meta shortcode you use in the form.
SEE SCREENSHOT BELOW
What this rule will do is check that the information in your hidden field matches the information in the users profile before showing them the form results. As you have set up multiple users to all have this shared field in their profile any logged in user who has “Company A” as their Nickname for example will be able to see this saved form.
Save and publish your view.
Now you just need to test it and make sure it all works. It can be a bit fiddly to get right the first time but once it’s all set up it’s a great solution to allow multiple people the ability to log in and carry on where a colleague left off with a form or edit the entries of someone else and can obviously be used in loads of other ways.
Happy building.
Chris
July 7, 2016 at 11:44 am
Hi Chris,
Thanks for taking the time to post your efforts for other users to benefit from!
Discussion closed.