I need to run this query “SELECT COUNT(1) FROM litigation_file WHERE fileName = ?”
in UiPath. which activity should i use and what configuration should i make ?
can anybody help to achive this ?
- Use Execute Scalar activity (from Database activities).
- Configure the Database Connection:
- Use Connect activity first to set up your DB connection (SQL Server, Oracle, MySQL, etc.).
- Properties for Execute Scalar:
- ExistingDbConnection → Your DB connection variable
- Sql → “SELECT COUNT(1) FROM litigation_file WHERE fileName = @fileName”
- Parameters → Add a parameter with:
- Name: @fileName
- Direction: Input
- DbType: String
- Value: your file name variable (e.g., fileNameVar)
- Output → Create a variable (e.g., countResult) of type Int32 to store the result.
This will give you the count of rows matching your fileName directly.
Use Execute Query activity with a DatabaseConnection. Set the SQL as “SELECT COUNT(1) FROM litigation_file WHERE fileName = @fileName” and add a parameter named fileName with its value. The result returns a DataTable from which you read the count.
For more:
If helpful, mark as solution. Happy automation with UiPath
you need to use DB activities
you would get the connection strings required here - PostgreSQL connection strings - ConnectionStrings.com
cheers