I am working on a collaboration form. I want to have the users profile information who opens the form from the task list when the form has reach step 2 to be entered into the form. This is so we can record who has approved an application.
I have tried property prefil mapping, but that seems to only work when the form is set to have User Authentication to Authenticated. this form is for the public initially, but then goes through collaboration steps to be completed.
As you may know, 'Tasks' in TM are essentially 'Saved Forms' in terms of how they're treated when they're rendered. This means that by default tasks will not run pre-fill services, because it is assumed that they were pre-fill as part of the task creation process.
I believe the best option for what you want to do, would be to run a Dynamic Data Service on form initialise. This service should check the current 'Step Name' and only be executed if the step is correct (i.e. Auth user accessing the form, rather than a member of the public). The service could then lookup the user's details and return them to the form.
This service would have the added benefit of being able update the user's information in the case that the task is re-assigned. Let us know if you need any assistance writing the task by asking additional questions specific to that topic.
Any assistance you can provide in this case would be appreciated. Would this be a data service written in groovy script in TM that we would need to action from the form?
Hi Don, can you confirm that by "tasks list" you mean the TM user space "Tasks" page? To access this page the user must be authenticated and hence the prefill you configured should work (unless its not meant to on the "review" task type).
However when a user opens a task for review the user login name (if authenticated) will be populated in the submission XML at /AvokaSmartForm/SFMData/SystemProfile/UserName and also the TM user account object will be linked to the submission object (accessible in post save/submission groovy services).
In the case the above XML element is populated but prefill doesnt work for what eve reason, you can call a custom Dynamic Data service from the form on init and pull additional user details from the TM server or do it later on on save/submit in TM services (submission completed processor, submission preprocessor, Form Saved Processor, ...)
Would be good if you can provide more details on your design
Also, would switching the User Authentication to both (Authenticated and Anonymous ) work for you?
Thanks for your reply.
To answer your questions I am trying to capture the first name and last name of the current logged in user from their user account details.
The task I am talking about is a task that is created through a collaboration. the basic set up is that a user submits form, goes through to the next person to review (at this point we want to get the reviewing persons details into the form when they log into the portal to see the task they have been sent and then open the form.) then the form is submitted.
the form has no authentication set initially as general members of the public open this form anonymously.