If no match found in a lookup can we add a key word as "Match" not found

In continuation to above post for below code:

dt1.AsEnumerable().ToList().ForEach(Sub(row) row(“c_prop_cd”)= If(dt2.AsEnumerable().Where(Function(r) r(“c_prop_cd”).ToString.Equals(row(“c_prop_cd”).ToString)).Count<>0, dt2.AsEnumerable().Where(Function(r) r(“c_prop_cd”).ToString.Equals(row(“c_prop_cd”).ToString))(0)(“c_prop_desc”).ToString,row(“c_prop_cd”).ToString))

If no match found in a lookup how do we add a key word as “Location Unknown”

@NIVED_NAMBIAR @Divyanshu_Divyanshu @prasath17

Hi @MANISHA_V_ARORA

Check this code

dt1.AsEnumerable().ToList().ForEach(Sub(row) row(“c_prop_cd”)= If(dt2.AsEnumerable().Where(Function(r) r(“c_prop_cd”).ToString.Equals(row(“c_prop_cd”).ToString)).Count<>0, dt2.AsEnumerable().Where(Function(r) r(“c_prop_cd”).ToString.Equals(row(“c_prop_cd”).ToString))(0)(“c_prop_desc”).ToString,“Location Unknown”))

1 Like