This is a short and honest guide to getting user input into your UiPath automation without losing your mind. You will see how to create variables, bind them to an Input Dialog, validate the results and use Assign activity and logging so your workflow does not behave like a gremlin during demo time.
Scope is the thing most developers ignore until it punches them in the test run. Variables in UiPath are not global by default. Give variables the smallest scope that still lets your activities talk to one another. Do that and your workflow will be readable and less likely to produce mysterious empty values when an activity runs in a different sequence.
Create descriptive names that tell you what they hold. Examples that do not make you cry later include:
Pick the correct data type at creation time. If you plan to do math, use Int32 or Double. If you expect freeform text, use String. Avoid vague names like temp or data unless you enjoy debugging archaeology.
Drag an Input Dialog where you need user input. Set a clear title and label so the user does not guess what you meant. In the Output property bind the dialog to the variable you created earlier, for example userName or quantityText. That binding writes the entered value straight into your workflow state.
Example in a simple If activity expression using VB style that UiPath accepts at expression points
Dim qty As Int32
If Integer.TryParse(quantityText.Trim(), qty) Then
Assign activity sets quantity to qty
Else
Log message that input was invalid and prompt again
End If
Want to normalize or convert values before using them elsewhere Use Assign activity to set variables after parsing or trimming. For example you can do an Assign called sanitizedName with value userName.Trim().ToUpper when you need uniformity for comparisons or lookups.
Logging is your friend when troubleshooting weird data shapes. Use Log Message activities to print variable contents at key points. If something goes wrong add a breakpoint and watch variables during the run. That is less painful than guessing at failures from the logs alone.
If you follow these basic UiPath practices for variables and Input Dialog activities your automations will be more reliable and easier to maintain. You will still make mistakes, because humans make mistakes, but at least your workflow will fail with dignity and clear logs instead of dramatic silence.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.