You have to login in order to post a reply to this topic.

2 replies [Last post]
gwideman
User offline. Last seen 1 year 30 weeks ago. Offline
Joined: 07/01/2010
Posts: 2

I've seen the various user-input dialogs in the "Message Boxes" category of actions, but these seem to only get one field of data from the user (or two for date range).

Is there some way to present a dialog with a number of fields on it, rather than just one?

Also, in conjunction with that idea, is there an approach to validating at least the format of the data that the user enters, in an effort to avoid an error when the user-entered data is later poked into the application being automated?

Finally, when a WinAutomation job performs "Run Application", is there a way for that external application to return values back to the WA job?

Thanks

-- Graham

D.M.Altizer
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 01/12/2010
Posts: 204
Re: Multiple-field user input dialog; validation?

 Some answers to your questions:

- Is there some way to present a dialog with a number of fields on it, rather than just one?
It depends on what you mean by "number of fields"... The "Display Select from List Dialog" action, allows you to present the user with various options, so that the user can select one or more of them.

If you want to give the user the versatility to enter his input, you can try the "Display Input Dialog" and use the "Multi Line" option.

- is there an approach to validating at least the format of the data that the user enters, in an effort to avoid an error when the user-entered data is later poked into the application being automated?
Actually, when you are using the "Display Input Dialog" action, regardless of what the user enters, WinAutomation considers it to be text. However, there are a lot of different ways to validate the user input.

For starters, if we assume that you want to verify that the user entered a number, you can use the "Convert Text to Number" action. Remember that the %UserInput% variable will always be text. If the user entered a valid number, then the specific action will be able to convert the input to number, if not, it will throw an error that you can handle through the "Exception Handling" tab (and possibly prompt the user to enter the number again).

Besides this case-specific way to validate, you can do more advanced validation through the "Parse Text" action that supports Regular Expressions. If you have ever worked with validation in Web Forms through JavaScript, you must have come across regular expressions since they are the main tool to validate user input: you can use them (both in Web Development and WinAutomation) to validate email addresses, phone numbers or pretty much anything that you can imagine.

- when a WinAutomation job performs "Run Application", is there a way for that external application to return values back to the WA job?

Yes. If we are talking about a console application, WinAutomation's "Run DOS Command" action will grab the output automatically. If we are talking about a "Run Application" action you can wait for the application to complete (this is an option in the action's properties window), and tell the application to write the data to a file. Then WinAutomation can read from that file the information that you need to retrieve. 

There are other solutions too, but which one you should use depends heavily on how the external application exports the values. For example, you can use OCR, you can copy the information to the clipboard and then retrieve it with the "Get Clipboard Text" action etc etc.

__________________

==Dedicated Automation Solutions==

__________________

==Dedicated Automation Solutions==

gwideman
User offline. Last seen 1 year 30 weeks ago. Offline
Joined: 07/01/2010
Posts: 2
Re: Multiple-field user input dialog; validation?

Thanks DM for your detailed reply.  Summary:

Multiple Fields: Basically no. (Multi line = single field with multilines, not what I want.)

Validation: Regular expressions. OK, can do that. But that doesn't happen until after the data-entry dialog has closed. So that calls for exception handling, a loop, etc.

So to present multi fields, and validate in the dialog, I have to write that in some other environment as an executable. OK, can do, but then I need to pass those values back to WA. There it looks like we have the possibility that WA captures "stdout", but into a single variable which would need to be parsed (Subtext, Split, Parse maybe) into separate variables.

So, it's doable, but not very elegant and involves a whole separate development environment to get it done.  Such a shame, because WA already has most of the apparatus to do the multiple fields -- it just needs the single-field functionality expanded with "add another field".

So far I'm liking a lot about WA, for me, and for a group of client users, but this limitation to single-field input dialogs is a bit of an obstacle. 

-- Graham