I have a scenario where i have to validate character length of 2 string.
String A>12
String b>13
Validate Both the string and throw business exception with all the error messages how can i do that in uipath
Hi
Use a IF CONDITION like this
StringA.Length> 12 AND stringB.Length>12
If true it will go to Then part part where we can use any other activities we want or goes to ELSE part where we can use THROW activity with input as
New BusinessException(“length is more than the value”)
So that it will throw exception
Cheers
Concatenate both error messages.
Declare one string variable with a default value empty
strErrMessage = ""
if stringA > 12
{}else{
strErrMessage = "string A length failed"
}
if stringB > 13
{}else{
strErrMessage = strErrMessage + " " + "string B length failed"
}
if strErrMessage.Trim.Length > 0 Then
{
Throw Activity, New BusinessException(strErrMessage)
}
Regards,
Karthik Byggari
4 Likes
Thank you Karthik. This should solve it.
If that helped you please mark my post as solution.
Regards,
Karthik Byggari
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.