I am working on a problem where in i have an excel sheet and around 5 columns like below -
Now in the above sheet you can see that for three records(Highlighted) the vehicle No is there but rest all the values are not there.
Now when i see such a scenario i need to generate an outlook mail by entering all the 3 vehicle numbers in the mail.
How can i go about creating a workflow for this problem.
We can try looping through column “D” in which placing an IF condition which checks whether the cell contains value or not
After this we can store this in an array or we can make datatable to add these rows containing values
finally sending the mail with either datatable rows or array values
Hi @pravin_calvin
From the pic of the first excel sheet which i posted in this question - let’s say the first column “Name”
the first record(Prashant) is not present, in that case i need to store the vehicle no(57JHK)
and then send out an outlook mail that vehicle no(57JHK) documents are not there, this is just for one record, in general i need to iterate over the entire “Name” column and need to check where there is a missing record i need to capture the corresponding value(values if there are multiple missing values in "Name column) from column - “Vehicle no”.
Assign activity:
left side: arrCheckCols | Datatype: String( ) - String Array
right side: {“Name”,“Number”,“Date”}
Assign activity:
left side: arrNoOrphans | DataType: String()
right side:
(From d in YourDataTableVar.AsEnumerable
Let chk = arrCheckCols.Any(Function (x) isNothing(d(x) OrElse String.IsNullorEmpty(d(x).toString.Trim))
Where chk = false
Select s = d("Vehicle no").toString).toArray
Now, with arrNoOrphans we got the orphaned Vehicle Nos as an array and can use it within the MailBody e.g.
String.Join(",", arrNoOrphans) - one line, comma seperated
Or String.Join(Environment.NewLine, arrNoOrphans) - every no within an new line (Text Emails)
Or String.Join("<br>", arrNoOrphans) - every no within an new line (Html Body Emails)
In your solution if i only need to check the null values in “Name” column and then corresponding value i need to pick from “Vehicle no” then i need to make this change, correct?
Broadly correct. However your expression will return not only “vehicle no” but also some blank, because the following yellow cell match with your condition.
If you want to except them, the following will work, for example.