My workflow includes to read value from excel and populating them onto a webpage.
but before going to webpage i want to check my excel file if it has the value for all the mandatory field.
Here i will be checking if excel have values for mandatory fields and if it does not throwing the exception and terminating the flow while if the value for optional fields are empty then it must continue the normal execution.
Hi,
if u want to check that if the excel is having values then use if condition and write the condition as DT.Rows.Count>0 then process or else Exception
@Lahiru.Fernando
i used the same approach using dictionaries. i convert excel into dictionary, now i just need to check if there is any value present for each required corresponding key.
but i am facing problem with IF condition here, the expression i am using in IF is
item.Key.Equals(“keyText1”) And item.Value.Equals(IsNothing) Or item.Key.Equals(“keyText2”) And item.Value.Equals(IsNothing) Or item.Key.Equals(“keyText1”) And item.Value.Equals(IsNothing)
i have mentioned all the keys which needs to have some value and if value for the any key is null then excel validation error will be thrown.
Can u please tell me what am i writing wrong in IF condition
-Aishwarya
Here, the way you have written the condition is wrong. IsNothing is not checked like that. I have a workflow similar to what you are doing which I’m using for something else. This is how I’m doing it…
Not String.IsNullOrEmpty will return true if the string is not null or empty. Else it will return false which means the string is either null or empty.