Skip to main content

Hi,

Is there a way to call Web Request - Post method on drop down change event in Nintex Forms ?

This is my scenario, 

I have two drop downs on my form,

  Drop-down A : User makes a selection

  Drop-down B : need to be populated based of selection in Drop-down A

  Note : Drop-down B is in repeating section 

In the back-end once user makes a selection, I need to query a tool to retrieve data, below is my POST configuration :

Web Service URLhttps://domain.com/axis/services/

SoapEnv:Request :

                      

SoapEnv:Response :

                 

   

   I have configured the same in 'Web Request Control - POST method', and it's working fine. My issue is,

               1) How to extract the single record / multiple records from the response shown above ?

               2) How to populate Drop-down B,  with all the values under //DATA/Row id="1"/<D n="7797">, on drop-down A change event. 

   Can someone please assist ?

  Caroline Jung‌, I have gone through few of your threads, is this something you can help me with ? Appreciate your help.

You'll need to figure out the XPath expression to pull out that data from the XML that comes back.

The Web Request action has two XPath expressions it will use.  The one for Display and the one for ID.

Take your XML to some online XPath generator and that might help you build out the XPath you need.

Vadim


Hi Vadim Tabakman‌,

Thanks for your response. Finally, I was able to figure out Xpath expression.

Now, i am facing a strange issue, service request is working fine in 'Run Now' mode for the first time. If i close it, and re-open again and say 'Test Request', it's throwing "The remote server returned an error: (500) Internal Server Error."

First time : 

Closed it and preview the form, no results in drop-down. Back to edit mode of the 'Web Request - Control', selected 'Run Now' mode to see what's wrong, selected 'Test Request' and this is what I see,

I have compared both 'Request Body', but didn't find any difference.

This is what I tried,

Copy the request body shown in second pic, clear 'Request body' container and paste it back again, it's working again.

If I close this and test in preview mode, no result.

Is there something wrong, in my way ? Appreciate your help !


That sounds like really odd behavior.

1. check you are running the latest version of NF.

2. If you are, reach out to support because that should not behave like that.

Vadim


Hi, 

Our current NF version is 2.9.3.0, we are in the process of updating it to the latest version, if the behavior still exist, will reach out to Nintex Support.

Coming to my second point of question, 

2) How to populate Drop-down B,  with all the values under //DATA/Row id="1"/<D n="7797">, on drop-down A change event.

Below are my scenarios, 

  • I have a text-box for user to input emp id,
    • am not sure, whether we can load all employees starting with that ID in a drop-down, while user typing ID, from back end. (Similar to 'SharePoint people picker' control).
    • If not, I am planning to display a button next to text-box named 'Search'. Once user clicks it, 2nd text-box need to be populated with employee name.

      e.g. :  Text-box 1 : 765454 (btnSearch)
                Text-box 2 : employee name oauto-fill on btnSearch click event]
  • Cascading DD,
    • upon selecting value in one DD, second DD need to be auto populated, these values need to loaded from back end.

This web request control allows itself to be populated, but i need a way to accomplish top mentioned scenarios.

Is this possible, please assist ?

Vadim Tabakman‌ Caroline Jung


Hi,

You can add a reference to a textbox (the control has to have a Name populated in the settings of the control) in the web service url (add a reference and select the name of the textbox in the Named Controls tab). This way the web request will be executed each time the textbox is edited (focus out). It can help you if you can add a parameter in the url of your web request to filter on the employee id.

Tell me if this can solve both scenarios you mentioned.


Hi Caroline Jung‌,

My apologies for the delay. If you go through my above comments, I have an issue with " Nintex Forms - Web Request " control, so we upgraded our version and contacted Nintex Support to resolve this. 

So, I didn't got a chance to try your scenario, but after the forms are working. I just followed your instructions and it worked like a charm !!

This is what I did for the cascading drop-down,

  • Created a calculated field, since on DD 1 change, I am taking sub-string of the option selected.
  • In DD 2 (Web Request control), referred this calculated field value in request body, since I am not sending parameters in the URL.

That's it, save and publish, the drop-downs are auto-populated as expected. Initially, I was in dilemma about this scenario,  because DD 2 is in repeating section. But, with no extra configuration, all the drop-downs in each row of repeating section are loading with values, on value change in DD 1.


I'm glad that Vadim and myself could help.

Thanks for your feedback happy.png


Hi Vadim Tabakman‌,

We just followed your suggestions to get this issue resolved,

  • Upgraded our NF version to latest 2.9.4.0, but no luck
  • Contacted Nintex Tech support,
    • Nintex tech person, looked at the issue and tried all the alternate ways to see what's wrong
      • Alternate ways :
        1. Copied XML (from Request Body) and pasted it in notepad (not notepad++) applied word wrap, later pasted it back to Request Body, but No Luck.
        2. Created a new list column (ML - Plain Text) in the list, and pasted this XML in it and tried to refer it in Request Body from named controls, but No Luck.
        3. Created two new controls on NF, label and calculated value, and pasted this XML and referred those in Request Body from named controls, but No Luck.
        4. Created a new WF, and utilized 'WF Action - Web Service', for testing, it worked here. So, copied XML from WF back to 'Request Body' of NF, still No Luck in forms.
    • After an hour, we navigated to an XMLFormatter online, and pasted our XML there and formatted it, took the formatted XML and pasted it in a Notepad and from there pasted back to NF Request Body, then we took a long breathe.Finally, it worked both in 'Run Now' mode and 'Execute Mode' after this. Even the Nintex tech person was saying, Notepad should take care of formatting, but it didn't.

Posting all the scenarios we tried, these might help someone else in the community.

Thanks again for your recommendations. 


Hi Caroline Jung‌,

I have one another scenario, which I want to discuss,

We have around 3000 records of employees in the back-end, all these need to loaded in the drop-down of NF using web request, but business need some sort of text box on the drop-down to search for the employee, instead of scrolling through 3000 records of drop-down.

Once employee is selected, his ID and Designation need to be auto-populated in the text-box or labels next to drop-down.

I was able to load all the employees in the web request - drop-down but stuck at search box, even I had a look at 'Multi-select' format of web request control, but this wont suit my requirement.

This is not a new one, they changed the below previous scenario to above mentioned one,

I have a text-box for user to input emp id,

  • am not sure, whether we can load all employees starting with that ID in a drop-down, while user typing ID, from back end. (Similar to 'SharePoint people picker' control).

Can we utilize web request control - similar to autocomplete drop-down, please assist ? I am not sure whether this need to be created as a new question, if yes, please assist, I will do so.


Thanks.


Hi,

I have small issue with these service calls, on page load all these calls are getting executed, even though the drop-down value is 'Select..'.

I tried to disable the controls, based on DD value, even they are getting executed. Is there a way to conditionally handle these calls ? My page is getting freeze, as all these calls are made at once.

Please assist, thanks.


Glad you got it working!! :)


Hi,

I think that this discussion is about the same problem as you mentioned :

https://community.nintex.com/community/tech-blog/blog/2015/10/27/nintex-forms-enterprise-sql-request-and-web-service-request-enhancement#comment-13331

Tell me if it helps you


Hi Nagarjuna

If you´ve found out the solution, that´s good, for any other users, hopefully this will help:

The trix is to have no whitespace between closing and open brackets. When you paste in your xml, always be sure that closing and opening brackets do not have space between them. You can fix that in notepad before paste-ing. Taking your xml from the xml formatting tool and paste-ing it into "Run now" will work for the first time. But when you run it again and then the actual form, the designer creates some mix-up in the markup.

For me, this works: <Item>Some value</Item><Item>Some value</Item>

This does not work:<Item>Some value</Item>   <Item>Some value</Item> 

So, paste your xml in the "Request Body" windows without any spaces.


Hi Caroline Jung,

Not sure if you can help me or not.  I am trying to do something similar to what Nagarjuna was attempting to do (cascading drop down web request fields).  I have tried to filter on a field in both my web service URL and in the filtering options on the web request control as well.  If I type in the value I am trying to filter on in either of these steps, it filters the drop down field accordingly.  However, as soon as I point it to a field on the form (either another web request drop down or a text field with a default value, it returns 0 results.

Any help would be appreciated.

Thank you,

Charles Ralston


Hi Charles,

So what you mean is that a default value on a text field is not correctly taken into account when referencing this text field in the web request control. But it's OK when you manually change the value of the text field. Is that correct?

If so maybe you can use a calculated value which could reference the text field (if the text field is empty, set your default value) and use the calculated value control in the web request


Reply