Start a new topic

check a virtual field "no valid address" to true via API

Hi ,


I wanted to check a virtual field "no valid address" to true via API based on the address street1 value comes from IOM Luminate on RE Connector as below:

Address Unknown
A/U
AU
TBD
N/A
NA
 here is my codes:

With Import.Fields

   If (.GetByName("Participant - HomeAddress - Street1").Value = "Address Unknown" _

 Or .GetByName("Participant - HomeAddress - Street1").Value = "A/U" _

 Or .GetByName("Participant - HomeAddress - Street1").Value = "AU" _

 Or .GetByName("Participant - HomeAddress - Street1").Value = "" _

 Or .GetByName("Participant - HomeAddress - Street1").Value = "TBD" _

 Or .GetByName("Participant - HomeAddress - Street1").Value = "NA" _

 Or .GetByName("Participant - HomeAddress - Street1").Value = "N/A") Then

   .GetByName("No Valid Address").Value = True

     Else

        .GetByName("No Valid Address").Value = False

     End if

 End With


These codes work for "Address Unknown" ,"", "A/U","N/A"

But don't work for "AU","TBD","NA"

Could someone tell me why?


Thanks

Doreen


Certainly looks like it should work.  Does it work in code tester?  Any hidden spaces?  I'm curious if your tried something like .GetByName("Participant - HomeAddress - Street1").Value.StartsWith("N/A") if it would work.  Or maybe even Trim(.GetByName("Participant - HomeAddress - Street1").Value) = "N/A"

Hi John,


Thank you for your response. I used code tester to test. Same outcome. 

When I replaced code with :

.GetByName("Participant - HomeAddress - Street1").Value.StartsWith("N/A") , it prompted with the error message as below:

StartWith is not a member of string.


if I replaced code with Trim(.GetByName("Participant - HomeAddress - Street1").Value) = "N/A" to test via code tester, it produced the same outcome.


Thanks.


Doreen

Login or Signup to post a comment