Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Get user action on preSubmit

Hi everyone,

I'm designing a form, and i want the user to be prompted (using app.response) only when he deny a task in the workspace, but not when he approves it.

Is there a way to know inside the form which action is selected ?

For now, I put an app.response on the preSubmit event, but i need to call it only if he refuses the form in the workspace.

Thanks !

12 Replies


Level 10

Are you looking for a confirmation that they really want to deny it or give them some additional information?

There is a property on the User Task for this purpose. Under the User Actions tab there is a table that defines all of the routes shown to th euser. Click on the route that you want to modify and a dialog wil appear ...there is a check box that allows you to turn on this feature and add text to display a message to the user when that action is choosen.

Hope that helps.


Thanks Paul,

But what i'm trying to do is :

In the workspace, they have two possible route (two actions) : Approve or Deny.

I want to display a pop up where they can enter a message only if they click Deny.

The aim is to get the string they entered in the pop up and send it by mail, to let the user know why they deny his request.

Any idea ?


Level 10

You will have to modify the forms bridge code that is placed on your form. If you do not put it on at design time you will need to. Then look at that code and see when the action is chosen ...then you can modify it to put your app.response in place.



Level 10

Thinking about thois a little more might be able to add your app.response code to the preSubmit event on the form. You woudl check the AWS-ACTION field to see which action was chosen (not sure if it is populated at that time). This assumes that you have the process fields on your form.


Thanks again Paul,

That's what I was kind of asking in the first place ... I'm not that good in Javascript, and I don't really know where does the form makes the bridge with the workspace, and more important which var corresponds to the action taken by the user ...

I found some function, but they're called at initialization ...

I'm gonna keep looking, i'll keep you updated !

Thanks again Paul,

I can't find the field AWS-ACTION, where is it supposed to be ?

"This assumes that you have the process fields on your form". You mean that the two (or more) possible actions available to the user should be inside the form as buttons (ie a deny button and an approve button), and not set in the process via the workbench ?

If yes, what script should i apply on those buttons ?



Level 10

There is an object in the Custom Library called Process Fields .....this object has a number of fields and some code that is used with process management to get amd store the state of the task that you are in. If you do not have these fields then this information is stored in the Headers of your request and is not available on the form. Drop that object on your form and then you will have that field to manipulate and interrogate.


Hi Paul !

I managed to get the actions of the workspace "in the form" using the "process fields" object.

The problem is that AWS_ACTION is a dropdownlist, and the rawValue is by default to the first action possible and never changes.

I have put two actions "Approve" and "Deny" on the "assignTask". In my form i can actually see "Approve,Deny" as the values from the dropdown list, but i want this list to be hidden and the user to use the workspace buttons.

In fact the value of the dropdown never changes and is always to "Approve" even if I click on "Deny".

I think I'm so close ... Thanks again !



Level 10

When are you checking that value ...(in what event is the code)?


Hi Paul,

I'm checking the value in the click event of the AWS_SUBMIT button ...

I found a similar issue on the forum here

... And you already answered my problem ! Sorry I didn't found it in the first place, I wasn't looking for "AWS_ACTION"

I'll try to comment the two "remerge()" instances and i'll keep you updated !

Thanks again Paul

Hi Paul,

I commented 3 instances of "xfa.form.remerge()" and it worked well !

Thanks for your patience and quick response !!


Level 4

Hi pguerett,

I have a similar problem like the above.

The issue is that if the application asset is selected in the assign task activity, I am able to get the userSelectedAction via AWS_ACTION in presubmit.

But if I use a document varialbe(a xdp DOCUMENT) as a presentation document. The user action when captured in presubmit is null.

Is there any way to capture the user action in workspace in a assign task activity that has a document variable set as presentation document.

Regards -

Ashok D.