Custom Form+Time Submitted+Asset Listing

Does anyone know if it's possible to get the submission time to display in an asset listing? The documentation (upon further scrutiny) indicates it's not possible but I thought I'd ask here before having a breakdown.






Cheers!

The time submitted should be the same as the asset created date, so, in your listing you could just use %asset_created% or in php date: %asset_created_g%:%asset_created_i% %asset_created_a%.

Is it possible to use something like %asset_created_readabledate%? I'd be pretty sure the asset created date should be the same as time submitted.

Unfortunately this is a multi-page form, so it doesn't get submitted at the same time it was created. Indeed, we're counting on it being hours or days between creation of the "submission asset" and actually pressing "submit" on the form.


I was going to try and use the field as a boolean "has this entry been submitted yet?" keyword, but I've had to start implementing a workaround using a metadata field as I'm on a bit of a deadline.



Thanks for the suggestions though. :smiley:

What about using %asset_updated%?

The only way I know of doing this (and there may be a better way) is to use DB data source. I'm no SQL guru, but these seems to work fine - change the asset id '193' to the form submission folder of your custom form. The query would probably need to be tuned by someone DB savvy if there was any sort of performance requirement.

    
    SELECT sq_ast_attr_val.assetid,sq_ast_attr_val.custom_val AS date_submitted FROM sq_ast_attr_val LEFT JOIN sq_ast_lnk ON sq_ast_lnk.minorid=sq_ast_attr_val.assetid WHERE sq_ast_lnk.majorid='193' AND sq_ast_attr_val.attrid IN (SELECT attrid FROM sq_ast_attr WHERE type_code='form_submission' AND name='submitted')


That would build a list of asset ids and date submitted values which you could merge together (using javascript), or adjust the query to output the information you are gathering in the main asset listing.

Or on second thought, Nic hubbard's suggestion looks much better!

AFAIK the updated time still doesn't tell you if the form has actually been "submitted" or not, just that it's changed at some point.


I ended up setting a flag in the metadata on submission using the JS API, although we'll look at using a trigger later on to perform the same thing without using a client-side hack. :smiley: