How to update the status of each transaction in Database?

Hi All,

I am currently working on an automation, based the status of each transaction like Success, Business Exception, System exception I need to update to the database (MS Sql), how to do this in UiPath??

@lucky7 ,

i hope this video might help in solving your issue

cheers!!

@Somanath1,

I need to update in set transaction status

follow these stpes

1. Open “Set Transaction Status” in REFramework

  • Navigate to the SetTransactionStatus.xaml workflow in the REFramework.
  • After the “Set Transaction Status” activity, add a Database Update step.

2. Add Database Activities

  • Install UiPath.Database.Activities if not already installed.
  • Drag and drop “Connect” activity inside Init state (or use an existing connection).

3. Add “Execute Non Query” to Update Transaction Status

Inside SetTransactionStatus.xaml, add an “Execute Non Query” activity under each branch (Success, Business Exception, System Exception).

SQL Query for Updating Status

sql

UPDATE TransactionsTable  
SET Status = @Status, UpdatedAt = GETDATE()  
WHERE TransactionID = @TransactionID

Set Parameters

  • @Status"Success", "Business Exception", or "System Exception"
  • @TransactionIDin_TransactionItem.SpecificContent("TransactionID")

4. Handle Each Scenario

  • Success Path → Update status as "Success"
  • Business Exception Path → Update status as "Business Exception"
  • System Exception Path → Update status as "System Exception"

5. Close the Database Connection

  • Use “Disconnect” at the end of the process.

generated by LLM

cheers!!

@lucky7,

After Set Transaction activity in Set Transaction Workflow, use Database activity Run Command which is for UPDATE , INSERT , and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1.

Make sure you use Connect to connect to the database and then after Run Command use Disconnect from Database to disconnect the connection.