I am building a workflow where I need the user to enter a query into a search box, then fire off a request to a Web Service, and then populate additional fields with the results of the request.
So far, I have a form workflow that gets the search text, then it fires off a Call Workflow step that goes to another workflow with a Component Workflow starting point.
The web service is called and I get the results. I have set the variable to be output so I can get it in the first form.
So that all works..
My question is. How can I then populate form fields in the original form with the results?
It seems that if I submit the original form, it moves to another state, but I can’t see how to then create another form with which I can add result data to.
Hopefully that makes sense :-)
Best answer by MarkduToit
Hi Michael,
That’s awesome, Xtensions are definitely one of the most useful capabilities of Automation Cloud… absolutely love them. Just a quick question, were you able to test your Xtension in something like Postman or Swagger Editor and get a result?
Just to give you a working example, I have included the code from the Countries example I showed you above. There are a few thing that may just need to be tweaked to get it working, because if you were able to import it without errors, then you shouldn’t be far off.
When using the code above, I can then see the properties configured under the definitions section for the “get all” method in the Option label and Option value fields for my Data Source:
Option label - Common and Option value - cca3 from the definitions section
I thought I would send this through so you could have a look and see if you can get the above example working in your environment, and then perhaps use it to see if there are any differences or things you needed to include in your Xtension to get it working.
If I am understanding you correctly, you would like a Form (similar to the one used as a Start Form) to be populated with the results from the webService call, is that correct?
Just a few clarifying questions:
Are the fields that you want to populate displayed on the Start Form?
NOTE: these will never be populated if the webService call is in an action post submitting the Start Form, so it might not be worth displaying them on that form
Once the information is returned by the Component Workflow, are you wanting to add the information returned by the webService call into fields on a Form that a user needs to interact with in any way?
If so, you would need to create a Task Form and re-use any of the fields that may have been captured on the Start Form, as well as adding new fields for the properties you want to display from the webService call (and then set the values of those fields to the values of the returned items). I hope I am understanding your requirements, and if so, I hope I am making sense?
Please let me know if all of the above makes sense? If not we can clarify and try and get this working for you 😊
A task form sort of helps, but introduces another layer of complexity. I.e. who to assign the task to and now the user needs to enter a value and then go to email to continue the form.
Hopefully the following explains the scenario a bit more.
User wants to add a new supplier to our CRM for Accounts Payable purposes.
User opens form and is presented with a text box to enter an ABN (Australian Business Number)
They enter the ABN into the field and click Next to move to the next page of the form.
In the process of clicking Next, I would like Nintex to query the ABN API (which is possible), and return the Business Name for the ABN into a variable.
On the next page, present the user with the business name (in a read only text box) and ask for any additional fields to complete the new supplier request form.
Then they submit it and it then moves to a workflow of approvals after that.
100%, the requirement is much clearer now. Is there any possibility you could configure the webService as an Xtension perhaps? This way it could be surfaced as External Data for the form via a Data Source, and you would be able to achieve the desired result.
Just as an example, I have a form that allows me to select a Country, and once selected I return additional data about that country:
Country Selection Field displayed to user
Select the relevant Country from the list
Once selected, information is returned into the relevant fields for the user to review
That’s awesome, Xtensions are definitely one of the most useful capabilities of Automation Cloud… absolutely love them. Just a quick question, were you able to test your Xtension in something like Postman or Swagger Editor and get a result?
Just to give you a working example, I have included the code from the Countries example I showed you above. There are a few thing that may just need to be tweaked to get it working, because if you were able to import it without errors, then you shouldn’t be far off.
When using the code above, I can then see the properties configured under the definitions section for the “get all” method in the Option label and Option value fields for my Data Source:
Option label - Common and Option value - cca3 from the definitions section
I thought I would send this through so you could have a look and see if you can get the above example working in your environment, and then perhaps use it to see if there are any differences or things you needed to include in your Xtension to get it working.