Expand my Community achievements bar.

Data population in Form inside workflow

Avatar

Former Community Member
Hi,



We need to populate data into drop down box using certain query into the workflow.



is it possible if yes then what will be the step ??



Thanks in advance if some one can help me on this .



regards

Abhishek
22 Replies

Avatar

Level 9
Hi



The best way we've found of doing this is:

- Use our SQLPlus QPAC to run the query

- Use the "comma-delimited" output style to save the values into a comma delimited string inside a hidden field in the form

- Use some simple Javascript logic in the form to parse the string and populate the dropdown. (There's an example of how to do this in the Javascript reference guide.)



Regards,

Howard



http://www.avoka.com

Avatar

Former Community Member
Our requirement is that when a person login into FM on the basis of his userid we want to populate a dropdown box of a Form using a database.

(e.x. We want to populate all the employee name working under him using a MySQL Table)



Is it possible because we did not initiated the workflow till now ?

Thanks for your reply Howard

Avatar

Level 9
Aha!

You can populate it during a workflow, but I've not found any way of pre-populating the initial form.

The only way I've found to do this it to make the initial form just a very simple form that says:

"Please click the submit button below to initiate this process. A form will be created with the appropriate data, and placed into your worklist. Please check your worklist after submitting this form."



It's clunky, but it's the only way I've found to make it work.



Howard

Avatar

Former Community Member
Hi Howard,



I got one more solution but the problem is here when I am clicking.

http://localhost:8080/services it is giving

Dadobe.workflow.service.test.enabled=true



step are as follows



1st workflow just a SQL Q-PAC that performs the query and returns the results to a process variable.



- 2nd workflow the main workflow. This will be executed when the user clicks the Submit button on the form via Form Manager.







Here are the high level steps:



Create a workflow with 1 SQL Q-PAC to query the database and return the results. Ive attached a document I put together a while back describing how to use the SQL Q-PAC. Its unsupported documentation, but has worked for people trying to use it. Make sure the workflow is web server enabled via the Workflow properties and any necessary in and out variables that are required for the webservice are created for the workflow.

Save and Deploy this workflow.

Retrieve the WSDL address for this web service. There is an unsupported feature if you go to http://servername:8080/services, you can click the WSDL link for that workflow and copy it from the URL bar.

Open the form in Designer (form Designer) that contains the drop down list.

Click the Data View tab and select File > New Data Connection.

Click the WSDL File radio button and click Next.

Paste the address copied above into the WSDL File field and click Next.

Select the synchronoushInvoke option (unless you created the workflow to be asynchronous, the click invoke), but workflows are synchronous by default.

Click Finish.

Click on the field that should receive the results of the query and click the Binding tab on the Object palette.

Map the result of the web service to the drop down list field by using the Import/Export Bindings option on this tab to the variable designated as the out variable. (I included a screen shot to show this tab).

Map the request parameter to the variable designated as the in variable.

Add the web services execute button somewhere on the form. You can make this invisible by click on the button after youve dragged it on the form and setting the Presence to Hidden on the Field tab of the Object palette. (I attached a screen shot of this palette as well.)

Add script to click the execute button when the form is opened. This will execute the web service. For example, click on the root node of the form from the Hierarchy and select the docReady event from the Show drop down list of the Script Editor. Then, add the following script (Ive included a screen shot of this as well:

synchronousInvokeBtn.execEvent(click);

Save the form and re-publish it to Form Manager.

Create the main workflow.

Avatar

Former Community Member
We made the service enable but again I can not able to populate any data of webservices enable workflow into the form.

Avatar

Former Community Member
Evoking the button's "click" event seemed a bit clumsy to me so I found out how to execute the web service in the form:ready event. Use the script: xfa.connectionSet.PrepopulateExpenseClaimWebService.execute(0);



Can anyone provide input on how to configure the SQL QPAC to point to the JNDI data source of the Workflow database? I'm trying to get the "pre-populating a form" tip sample working.



Also, it appears like none of the "in" variables are actually getting into the web service. I tried a simple service that takes an "in" variable and puts it into an "out" variable. The "out" field never gets a value because it fails to get the "in" value. I have tried many scenarios but cannot figure out why the "in" variables are not working.



Any thoughts.



Duncan Campbell

Avatar

Former Community Member
Hi,



I have written simple WSDL and associated with that my Form.



When I am opening that form in my system (having Acrobat writer) it is populating the data value into the form and while I am trying to open same PDF into the other system containing Adobe reader my form can not able to execute WSDL and no Data is coming.



Any one is having any clue on this ??

Avatar

Former Community Member
abhisek,



Reader will not permit Web Service access, unless the form has been enabled with Reader Extensions.



This is an old story, much discussed in other forums...



If you need this functionality, then you should deploy Reader Extensions in your environment, which comes at additional cost.



Once deployed, there is a tight integration with the rest of LiveCycle modules. You may then set the form properties accordingly, through the adminui screen.



HTH,

Evangelos



PS: There are also some other benefits in this approach, such as the possibility to take the form off-line (working with a form outside of the workflow environment, saving data within the form, and eventually submiting the form back to the WF process)

Avatar

Former Community Member
Our Form is uploded into Form Manager as XDP.

I am not sure about enabling XDP through Reader extension will allow us to merge database..



I think enabling through reader extension will help if we will upload that as PDF or opening that PDF stand alone..



Not sure on this issue



Regards,

Abhishek

Avatar

Former Community Member
Hi

I have a expense form with two fields called Claimant's name and Manager name.I have been able to pre populate these two fields based on the person who log's in to form manager and opens the Expense form.As far as pre populating a list is concerned, I think this can be done.I can definately give a solution by monday when I get bk to work

thanks

Avatar

Former Community Member
If you will give me some detail solution on this It will be great for me..



Regards,

Abhishek

Avatar

Former Community Member
Hi

I have the workflows exported, I do not think I can add attachments here.If you can give me you e-mail address I can send you the workflows.

Basically these are the steps

You create a workflow which is web services enabled and in this workflow you do the SQL query using the SQL Qpack.You store the value returned by the sql query in a process variable.

Then you need to create a dataconection using the WSDL file in the form in which you want to prepopulate fields.You should point to the WSDL of the workflow created above

On the same form add a button of type "Execute" and make it invisible.In this buttons Initialize event add the following javascript

$connectionSet.DataConnection.execute(0);Where DataConnection is the name of the DataConnection created above

Then go to the bindings tab of field you want to prepopulate and add the following

!connectionData.DataConnection.Body.synchronousInvokeResponse.MgrCommonName

in the import/export bindings section. MgrCommonName is the processVaribale defined and poulated in the first workflow which was created

So now when you login to FM the first workflow will execute then the fields in your form will get prepopulated

Avatar

Former Community Member
Hi Thanks WF USER,



I am giving my mail id pls send me the sample workflow that will be great for me

my mail id is "abhishek.upadhyay@wipro.com"



Abhishek

Avatar

Former Community Member
I am facing problem in again in invoking my web service workflow.



I had written a simple WSDL for getting creator id.

I have associated that with my form and saved my form as XDP and uploaded that into form manager.

When I am login into Form Manager and opening that form on system which is having Acrobat writer it is able to populate the data.

But when I am login into the System which is having Adobe Reader it can not able to populate the data.

On some system which is having Acrobat Writer it gives error

"error to attempt to read from file PATH OF FILE"



Pls let me know if some one can help me in This

Avatar

Former Community Member
Hi 'WorkflowUser'



I would like to have a look at this solution also.

Please could you forward to tds@arch.co.uk



Regards,



Thierry

Avatar

Former Community Member
Hi All

this workflow prepopulation require ARES to be installed on the system..Then only it will work with the reader..



This is not feasible for us to go for one more software...

Avatar

Former Community Member
Hi, I have a simple query. I want to add an empty value inside a dropdown list in adobe forms.

Please let me know how I can do it.



Thanks,

Sangeetha.

Avatar

Former Community Member
I am trying to setup the URL in submit form to replace in the URL mailto:employeeemailaddress.com an address in the form itself. Is this posible?

Avatar

Former Community Member
I want to do the same thing Mike does. There must be a simple way to reference user-entered text in expressions like this. Brackets or some other sort of markup around the object name?

Avatar

Former Community Member
This seems like the same issue as Duncan above was having but I didn't see an answer. here's where I'm sitting (note, I'm using acrobat professional so wsdl calls have not be a problem):



I've got a form that allows me to populate a drop down from a button-triggered WSDL, this works fine. The list is populated and then I can select an item from the list, which triggers another WSDL on the change envent using xfa.connectionSet.callCourse.execute(0); (this also works great). I'm running difficulty with passing the value of the selected item to the WSDL so as to be able to do a sequel call with the passed value.



The value I'm passing comes from this.boundItem(xfa.event.newText) which works fine as far as grabbing the correct value.



Code on dropdown change event:

//Execute data population

xfa.connectionSet.callCourse.execute(1);



var passedId = this.boundItem(xfa.event.newText);

var callCourse;



courseId.rawValue = passedId;

courseName.rawValue = xfa.event.newText;

courseDesc.rawValue = calledDesc;



This is as far as I got. I believe I have to change the parameter in xfa.connectionSet.callCourse.execute(0); from 0 to 1 and then I set this.boundItem(xfa.event.newText) to a variable passedid. Then in the WSDL workflow I set an 'in' variable called passedid and and an 'out' variable called callcourse' which was used as the output for a sequel call reading:



select desc from adobe.un_register_courses where id=/process_data/@passedid



doesn't seem to work (the PDF form goes blank when I select a dropdown item, if I set the parameter back to 0 it works normally but doesn't actualyl pass anything to the WSDL that I'm aware of). Any suggestions?