@DBlookup AND Loop?

Ok, I think I’m making this too complicated, but we’ll blame that on an extra day in February!! Here’s what I need to do . . . I need to do a lookup against the “SUC” view to pull the e-mail address of the contact person based on her unit matching the unit on my form I am opening. I have a computed field = “StewCon” doing a lookup against the SUC view, but I’m getting nothing. I think I need to loop through the view somehow and match the unit on my form with the unit in the SUC view then pull that person’s e-mail address, but I have no clue how to do this. Any help?

@DbLookup(“”:“”;“”:“”;“SUC”;“Unit”;3)

Subject: @DBlookup AND Loop?

Hi Patty,

You do a lookup on the word “Unit” and not the field value.

Remove the quotes and the lookup will work

@DbLookup(“”:“”;“”:“”;“SUC”;Unit;3)

Regards,

René

Subject: RE: @DBlookup AND Loop?

Hi Rene - I’m now getting an error “ERROR: Server error: Entry not found in index” The column numbers start with 0 or 1?

Subject: RE: @DBlookup AND Loop?

Column number starts with 1

Entry not found in index means the value of unit is not found in the view.

Is the 1st column sorted?

Does the value of unit in the document equally match (case sensetivity, spaces behind value, etc) the value of unit in 1st column of the view?

Subject: RE: @DBlookup AND Loop?

Thank you for the clarification, Rene. The problem was there was no contact for the Unit I was trying to test with. I now have the StewCon field pulling the matching Unit. Now, based on that, how do I also get it to pull the e-mail address from the SUC view as well? I need the matching unit’s contact person’s email address (which is column 4) so I can email them about the document.

Subject: RE: @DBlookup AND Loop?

Doesn’t the same way work, but then for column 4?@DbLookup(“”:“”;“”:“”;“SUC”;Unit;4)

By the way, it’s always good to catch the “entry not found in index” error:

var:=@DbLookup(“”:“”;“”:“”;“SUC”;Unit;3);

@if(@iserror(var);“”;var)

Subject: RE: @DBlookup AND Loop?

Rene, you are awesome! Thank you, yes that worked. And, I added the error check. Thanks so much!