hi
How to get text from user in price range x-x format?
I used the input dialog but I didn’t get input in the format I wanted.
It’s more complicated, but you could use the UiPath Forms to present the user with a form to fill out and then you have many more options on controlling what they enter.
podrías darnos mas contexto sobre tu pregunta pls,
por ejemplo, cual es el formato actual del input dialog y cual es el resultado luego de usar el get text
Hi
→ Add an Input Dialog activity to your UiPath workflow.
→ Set the Title property of the Input Dialog activity to “Enter Price Range”.
→ Set the Message property of the Input Dialog activity to “Enter the price range in the format x-x”.
→ Set the Result property of the Input Dialog activity to a variable of type string.
→ Add a Match activity to your UiPath workflow.
→ Set the Input property of the Match activity to the variable that you recived from input dailog box.
→ Set the Pattern property of the Match activity to the following regular expression:
^\d+-\d+$
→ This regular expression will match any input that is in the format x-x, where x is a digit.
Add an If activity to your UiPath workflow.
→ Set the Condition property of the If activity to the Success property of the Match activity.
→ If the condition of the If activity is true, add a Write Log activity to your UiPath workflow.
→ Set the Message property of the Write Log activity to “Price range entered successfully.”.
→ If the condition of the If activity is false, add a Write Log activity to your UiPath workflow.
→ Set the Message property of the Write Log activity to “Price range not entered in the correct format.”.
Thank you
Hi @Kevser
- Input Dialog (Value=UserInput)
- Is Match
Input: UserInput
Pattern: “^\d±\d+$”
Result: isValidInput
- If (Not isValidInput)
- Message Box
Text: "The input format is incorrect.
Hope this helps
Welcome to the community
Two ways here
- Instead of one input dialog use two and ask for start and end separately and then concatenate the values
str1 + "-" + str2
- Use UiPath forms and build a form and in forms you can specify rules for the values to be entered and you can specify the value type as required…but for the scenario this is little complex…better to go with first option
Hope this helps
Cheers