Read the Config file into a DataTable using the “Read Range” or “Read CSV” activity in UiPath.
Use a Switch activity to process each ID:
Set the Expression to the ID value from the database (e.g., “AH”, “AU”, etc.).
For each case in the Switch activity, use the DataTable.Select method to filter the DataTable based on the ID and retrieve the corresponding Description.
Read Range (Excel Application Scope) -> Output: dtConfig
Switch (Switch activity with Expression set to ID from the database)
Case "AH"
Assign: description = dtConfig.Select("ID = 'AH'")(0)("Description").ToString()
Case "AU"
Assign: description = dtConfig.Select("ID = 'AU'")(0)("Description").ToString()
Case "AW"
Assign: description = dtConfig.Select("ID = 'AW'")(0)("Description").ToString()
Case "B"
Assign: description = dtConfig.Select("ID = 'B'")(0)("Description").ToString()
Case "M"
Assign: description = dtConfig.Select("ID = 'M'")(0)("Description").ToString()
Case "S"
Assign: description = dtConfig.Select("ID = 'S'")(0)("Description").ToString()
Default
Assign: description = "Description not found"
End Switch
Use For Each Row activity to loop through each row in the database DataTable.
Assign: currentID = row("ID").ToString()
Use a switch activity to match the ID from the database DataTable with the corresponding value in the Config DataTable.
Set the Expression property of the switch activity to currentID
Case “AH”: