How to print the 'True' values in IF condition

In excel file I have 30 columns, using for each row to enter data in an application where I have to check whether mandatory fields are empty or not. For that I have used ‘assign activity’ to store 15 mandatory fields. Now to find out which mandatory field is missing i have used IF condition but unable to print those variables. I want to know which mandatory field is missing with the column name

Hi @sushmithakiran02

I think you are telling some things half only.
Actually not able to make some link. :sweat_smile:

Can you more clarify that actually what you are trying to do in IF condition and inside IF then ??

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

I have three variables with string values captured from excel. using IF condition I want to know which variable is empty.

@sushmithakiran02 Do you want to know exactly which Column is Missing the value, If that is right then you may have to use Separate If condition to Check the values.

Yes, I want to know exactly which column is missing.
Yes, I can use multiple IF conditions for every row item but I just wanted to know if anything else can be done. To know all missing column names in one condition.


@sushmithakiran02 How many Columns do you have to check ?

You can loop it in for each say For Each Row.ItemArray
So it will loop your row data one by one for each column then u can use single IF to check is data is available or not.

Doing the same

No you are doing it in for each row right then again use For Each only for Row.Itemarray

15 Mandatory fields

@sushmithakiran02 Are you using Type Into Activity inside the For Each. So if the value that you want to type is Empty, do you want to ignore the Type Into or Do you have to type some other value?

I should also be able to print the column name
ex: The Mandatory field ‘Name’ is missing
Is that possible?

I should throw an error and end that transaction by sending error message to the client.
ex: Mandatory field ’ Name’ is missing

@sushmithakiran02 How about we check if the mandatory fields are missing the values before using For Each to Type the values.

We can also get the list of Column Names that are missing. If the list contains missing names you can Send the Error Message and End the Transaction, If the list doesn’t contain missing mandatory fields you can perform the Type Into execution. Is that fine ? Or do you still have to type in the other values which are present?

But to the above method we would need to have the List of Mandatory fields i.e Column Names that should have values in it.

Check this workflow hope it works
Main.xaml (9.0 KB) test.xlsx (8.3 KB)

“We can also get the list of Column Names that are missing.” - This is what I wanted
Please tell me how to do this?

@sushmithakiran02 Again I would need more clarification :sweat_smile:

Check the below Data :

Name ID Place Country

Do you want to Check if each row has a missing value or the whole table has any missing value? Considering all the four fields are mandatory fields

each row is considered as one transaction sent by different clients so I need to send a mail to that particular transaction client with that missing data
example from ur sample data: for 1st row - mandatory field ‘Place’ Is missing

@sushmithakiran02 Check this Workflow : (8.0 KB)

Considering that you know the Column Names, and the Array mandatoryColumnNames should contain the exact Column Names as in Excel file. This should be the output you needed.

1 Like

Thanks it worked :smile:

1 Like