How to compare two string values and print status

How to compare two system-generated string values and update status?
Below Steps are I have followed:
Step:1
System generated values are by using the get text method and Write cell activity I am pasting in Excel.
Step 2:
For Eg:
1st value iam pasting in excel by using this header ActualAmountPayable, Second value iam pasting in excel by using this header ActualAmountPayablePQM

Step3
Next in If condition
Current row(“ActualAmountPayable”)= Currentrow(“ActualAmountPayablePQM”)
Then ==> Passed
Else ==> Failed

Output(Issue):
While executing its not comparing then block directly What I am maintaining in else block that one its comparing and Pasting the value in Status column, Could any one pls help here

please share some visuals fom your modellings, Thanks

When working on the same Datarow and comparing column values we would also do

currentRow(ColNameOrIndex1).ToString.Trim.Equals(currentRow(ColNameOrIndex2).ToString.Trim)

Cint(Current row(“ActualAmountPayable”).tostring).trim= cint(Currentrow(“ActualAmountPayablePQM).tostring).trim

If the comparing values is integer you can use

image
image

we would also inspect the part, where value1, value2 is set (in detail)

Kindly note:

as we trimmed the values also

To compare two string values and print a status, you can use the following steps:

Use the “Assign” activity to store the two string values in separate variables. Let’s call them String1 and String2.

String1 = “First String”
String2 = “Second String”

Make sure to replace “First String” and “Second String” with the actual strings you want to compare.

Use the “If” activity to compare the two string variables. To do this, you can use the condition:

String1 = String2

This condition will evaluate to True if the two strings are equal and False if they are not equal.

Inside the “Then” section of the “If” activity, you can use a “Log Message” activity to print a status message. For example:

“The two string values are equal.”

Inside the “Else” section of the “If” activity, you can use another “Log Message” activity to print a different status message if the strings are not equal:

“The two string values are not equal.”

Your UiPath workflow should look something like this:

Assign: String1 = “First String”
Assign: String2 = “Second String”

If (String1 = String2)
Then
Log Message: “The two string values are equal.”
Else
Log Message: “The two string values are not equal.”

Make sure to customize the string values and status messages as per your specific use case. This will allow you to compare two string values and print a status message based on the result of the comparison.