Database Lookup/Import

I’m trying to Import data to populate a view, the data imports into my view but when I try to make a selection from a ‘Dialog List’ field in the Main Doc I can’t see the data and I get the following error: “Keywords must be text!”. If I clear the imported data and key in data using the Material Code form in the database it works. The file that I’m importing from is a WKS (1-2-3).

**Main Document Form:

Field called: MaterialCode - Dialog

List/Editable with formula @DbColumn(“”:“”;“”:“”;“LookupMaterialCode”;1)

Field called: MaterialDesc - Text - Computed with formula @If(MaterialCode = “”; “” ;@DbLookup(“”:“”;“”:“”;“LookupMaterialCode”; MaterialCode; 2))

** Material Code Form:

Field called: MaterialCodeUp - Text/Edit

Field Called: MatericalDescUp - Text/Edit

**LookupMaterialCode View

1st Column: MaterialCodeUp - General

2nd Column: MaterialDescUp - General

** Import File WK3 (1-2-3)

Ist Field: MaterialCodeUp - General

2nd Field: MaterialDescUp - General

I have tried columns as Text, Number, General. ??

Hopefully there is something simple that I’m missing.

Appreciate any help

Regards… Marion

Subject: How are the values stored in the document?

Check what data type MaterialCodeUp is actually stored as, make sure it is text when you look at the document properties.During import (you don’t describe how you performed it), you may need to fix the data types as you populate the fields.

Subject: Database Lookup/Import

Hi Karl-Henry,

When the document is created using the form, both fields are ‘Text’

Imported document, MaterialCodeUp - ‘Number’ & MaterialDescUp - ‘Text’

Import Procedure:

I am given an Excel File which I resave as WK3 (1-2-3).

I change the headings to match my field names.

From the view where documents will be received,

-File

-Import

-Select the WK3 file and Import

-Import as: Main Document

-Use Form: Material Code Form

-Defined by the WK3 Title

-OK

I have tried to change the MaterialCodeUp column to a Text in the WK3 file but it keeps reverting back to General.

Any ideas??

Subject: CSV import agent

I suspect that the content of one of the fields you get in the Excel spreadsheet is a numeric value, for example 3210034. When you import it, it does not matter that the field in the Notes form is specified as text, the importer will store it in the Notes document as a number (which would explain the issue you are having).That is why I asked what the document properties infobox show as data type for the field.

Your import process is more complicated than it has to be. Write a simple CSV importer in Lotusscript, then you can perform a doc.ComputeWithForm to get the data types correct, and you can also perform other checks on the imported values if you like.

If you write a CSV import agent, you only have to save the Excel document as .CSV, and you are done…

I even wrote a CSV import class a while back and posted the code on my blog.

http://blog.texasswede.com/import-csv-from-excel-into-notes-documents/