Submission ID to form field or metadata


(Pomster09) #1

Guys I've gone as far as I can with my custom form. I've managed to set up a metaschema and apply it on submitted. Though, I'm struggling to no end with the %form_submission_id%. I need to somehow get that into the metadata, as I'll be using that as a unique number.

 

I've tried just about anything to get that number, but seems I can only write it to the thank you page, or the email address. Is there no way of grabbing this number into the form submission, on submission? I know it's the asset ID of the submission, but unless I can pop it in the submission metadata I won't be able to search for it in my custom dashboard. Anyone? 


(Nic Hubbard) #2

I did a test and it seems to work correctly for me to set a metadata field of the Form Submission to its own Asset ID. This is what you were wanting to do, right?

 

I am testing this on 4.14.2. You should be using the %asset_assetid% keyword within the trigger in order to get the submission ID:

 

 

Did you make sure to apply the Metadata Schema to the Custom Form so it cascades rather than trying to apply it to the submission with a trigger?


(Pomster09) #3

Nic, are you going to the Squiz user conf? I don't know how many times you've produced the goods in helping me out. I owe you a beer or two.

 

Now the process of getting the form data into the metadata is complete. All I have to do now is get on with building a dashboard where I can use the data. By the way, am I correct in assuming a user (with permissions) should be able to read the contents of the metadata, edit it and save it back?

 

Cheers again.


(Nic Hubbard) #4

Nic, are you going to the Squiz user conf? I don't know how many times you've produced the goods in helping me out. I owe you a beer or two.

 

Now the process of getting the form data into the metadata is complete. All I have to do now is get on with building a dashboard where I can use the data. By the way, am I correct in assuming a user (with permissions) should be able to read the contents of the metadata, edit it and save it back?

 

Cheers again.

 

Happy to help. Unfortunately I won't be at the user conf. It gets expensive coming from the US. :)

 

Yeah, if the user has write permissions they should be able to edit the form submissions including metadata.

 

Good luck!


(Bart Banda) #5

Just so you know for future reference, you don't need to have a metadata field for your asset id in order to search by asset id value, you can simply set the search to target the asset id attribute of the asset. 

 

Also, you don't need a trigger to set the asset id into the metadata field like above, you can simply just set %asset_assetid% as the default value for that field, and the asset ID will then automatically get populated into that field when you apply the schema to assets or when assets get created with that schema cascaded onto them. 


(Pomster09) #6

I thought about that Bart, after the fact. I did try putting the submission id in the form field and it didn't work, I should have tried the asset id too?

 

The admins of this app need to update the content of the metadata. There's going to be about 22 - 25 people managing the data. Is it best to build my dashboard edit functions in the "member section" that will search and display the records, or do I have to give this many people access to edit+, and then customise my edit+ template so they can only see the metadata fields?


(Bart Banda) #7

Yea, form submission id is the same value as asset id, so asset id would have worked.

 

If it was me and I had limited time, I would probably just give them access to Easy Edit and customise the interface slightly so that they can only see the metadata screen. If you have time up your sleeve, it would be nice to implement your own edit interface for the records on your member section, you could just use the JS API and custom HTML for all the form fields. But again, it depends on how many fields you have and how many of them are select, radio, checkbox fields which take longer time. 

 

Hope that helps.


(Pomster09) #8

The form itself has about 50 fields, but most of that data is none essential. I've initially set up metadata for 16 of those fields. I'd be happy to set this up in the members area, do you any example of achieving this outcome? I remember seeing something along the lines of what you're talking about at last year's squiz user conf. Someone presented the QLD master builders website and I was asking the guys down here (Melbourne) who built it. I think that is one of the best examples I've seen of managing such a complex business scenario, and that was done in the brissy office, do you know if someone there has a sample that may get me started?


(Bart Banda) #9

Yea I built the Master Builders eDocs system actually, and it all revolves around saving metadata values on form submission assets using the JS API, that's the core functionality behind it. You can see a brief video of it here: http://www.youtube.com/watch?v=gpCu-saVny4 (doesn't show any of the form editing though :( )

 

Unfortunately I don't really have any sample interfaces that you can access, and you need to be a Master Builders member to access the eDocs system. 

 

There is a basic tutorial on using the JS API and setting up a create page form that might be useful to you: http://manuals.matrix.squizsuite.net/web-services/chapters/basic-javascript-api-implementation

 

Hope that helps.