Simple Edit for Form Submissions


(Nic Hubbard) #1

Is it possible to edit a form submission using a Simple Edit layout? I tested the setup and it doesn't seem to work. I put a keyword into the layout, such as %question_field_7554_q1% but when previewing the form submission (using /_edit?limbo_assetid=xxxx) that keyword just gets printed as plain text.

 

I realize that a form submission can be edited in the _admin, but I need to layout the editing interface.

 

Ideas?


(Bart Banda) #2

Hmm, never tried it, what happens if you just print the %details-% keyword? 

If that doesn't work, you might be able to do it with the JS API, in which case you probably don't need to use Simple Edit. 


(Nic Hubbard) #3

Hmm, never tried it, what happens if you just print the %details-% keyword? 

If that doesn't work, you might be able to do it with the JS API, in which case you probably don't need to use Simple Edit. 

 

I realized I can just use the Exit and Save editing feature using ?SQ_FORM_7554_SUBMISSION=7575. This will actually work much better and will already have my form layout that I built.


(Bart Banda) #4

Ah off course, too easy!


(Nic Hubbard) #5

Ah off course, too easy!

 

Is there any protection in place to prevent someone from just guessing a submission ID and being able to edit someones submission?


(Robin Shi) #6

The submission ID is incremental so it's easy to be guessed out. Would you try asset builder and data record asset to get the control of the permission?


(Nic Hubbard) #7

The submission ID is incremental so it's easy to be guessed out. Would you try asset builder and data record asset to get the control of the permission?

 

It won't work here. It is an already established Custom Form that has been used for years.


(Bart Banda) #8

 

Is there any protection in place to prevent someone from just guessing a submission ID and being able to edit someones submission?

 

All form submission get created with public read permission denied. The only way a user could guess the idea and edit the submission, is if they have write permissions to it. 


(Robin Shi) #9

 

All form submission get created with public read permission denied. The only way a user could guess the idea and edit the submission, is if they have write permissions to it. 

I guess Nic is giving editors the write access to submissions but wants to restrict the permission per submission.


(Bart Banda) #10

I guess Nic is giving editors the write access to submissions but wants to restrict the permission per submission.

 

Yep, which you can easily do with a trigger. So don't cascade the write permissions on the submissions folder, but just have a trigger that grants write access to the user who initially submitted the form submission. 


(Pomster09) #11

This is what I was talking about with the dashboard I'm needing to build. This dash will be members only section. I needed the dash to be able to search and filter the submission data, and then a user who has member access should be be able to update the data if needed.

 

The first part of my dash would be to enable searching and filtering. Form submissions can be listed and filtered using asset listings, but I also needed to search the data, and squiz search didn't seem to be able to search the submissions.

 

To enable squiz search to search the data I'd have to create a data record. I didn't want to create separate data records as the submission already exists, so I took the advice of Bart and Nic and applied a metadata schema to the submissions folder. This schema contains all the fields from the form that the member users (admins) had advised they often have to update. Just think that Squiz Data Records are really just empty pages that carry artifacts in the metadata, thus almost becoming a database record. Then I created a trigger for each of those fields in the metadata. These triggers then populate the metadata on form submission. I've already tested a search and a asset listing on the form submission metadata, and the results are what I expected, very happy.

 

The next step will be to list the submissions using the search and asset listing, and display in a nice table. Clicking an edit link on the table row should take me to a page displaying a bunch of form fields pre-filled with the metadata. I'm hoping, but haven't tried yet, that I can have that save and exit function pop the edited metadata back onto the form. Sounds dead simple, but should allow lots of powerful possibilities. If it works I'll provide the sample dash at the next squiz conf.

 

So whatever solution works for you Nic, I'd love to know if that save and exit function is the right one for me.


(Pomster09) #12

One question about the above. If your website has edit+ installed, is it possible to override this by applying simple edit? Because simple edit would work perfect for my solution.


(Nic Hubbard) #13

One question about the above. If your website has edit+ installed, is it possible to override this by applying simple edit? Because simple edit would work perfect for my solution.

 

For my case I decided Simple Edit wouldn't work because the form was huge and extremely complex. So, allowing editing of the form submission using the original form was what I needed.

 

I am not sure how Edit+ works, but if it is like EES then you are not able use both that and Simple Edit.


(Greg Sherwood) #14

EES and Edit+ are loaded based on the design you have applied (you put code in there to load that interface) so you'll need to apply a different design to your page if you don't want Edit+ to load. You might want to do this by using SQ_DESIGN_NAME and a user created design: http://manuals.matrix.squizsuite.net/designs/chapters/using-alternate-designs


(Pomster09) #15

How do I get the URL to a form submission?


(Nic Hubbard) #16

How do I get the URL to a form submission?

 

Just add ?SQ_FORM_7554_SUBMISSION=7575 to send end of the URL. (Obviously with your asset ID and submission ID)

 

Manuals: http://manuals.matrix.squizsuite.net/custom-form/chapters/formatting-the-custom-form#Editing-the-Exit-Page-Contents


(Pomster09) #17

You are an absolute superstar Nic. That worked a treat.

 

I now have a search that searches the metadata I have on the form submissions. This presents the data in a table, the last column I have a link (created with your code) which says "edit this notification", click the link and it shows the original form with all the fields pre-populated. I edited a couple of the fields and then clicked submit. Checked the backend form submission log, opened the submission I just edited and wallah, the data was changed. This is perfect, I don't need to create any new template as simple edit, cause it's so easy to just update the original submitted data in the original form.

 

The only thing I see that may be an issue is that three fields, one required, were not pre-filled. I'd love to have them filled, but with 50 fields on the form and just about all the rest filled in, I'm not going to stress too much about that. Though I really should so if anyone knows of why these two don't get filled I'd love to know. One is a tick box with two options, although a required field, one or both options can be filled. The other two fields are jquery datepicker field that populates a text box. But thanks again Nic, it always feels great to crack these big issues, and I couldn't do it without people like yourself and others on these forums. Thanks to Bart as well for giving me the help with the metadata triggers.