From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Import of Excel data into the DIAdem data portal via a selection list in the user dialog

Hello everyone,

 

i would like to access the titles of the worksheets in an Excel file via a selection list in the user dialog. When selecting the title via the selection list in the user dialog, the respective title should be loaded into the data portal.

 

Can someone help me with this?

 

 

Best regards

Alexander

 

0 Kudos
Message 1 of 3
(1,089 Views)

Hello Alexander, 

 

May I ask if you had a chance to review the following articles?

 

Best regards.

0 Kudos
Message 2 of 3
(1,029 Views)

Hi Alexander_18,

 

The first thing is that you need a DataPlugin – as Edgar mentioned in his links.

Then you have two options.

 

The first option is very easy and does not need any further script code. If the folder is part of the “Search Areas”, then you can open the structure (root, groups, channels) of the Excel file and you can select the group which should be loaded.

Walter_Rick_0-1639120090476.png

 

 

In the second option you need to create a script. Below you find an example for reading the channel groups:

Dim oMyDataFinder, oMyConditions, oMyResults, oMyQuery, oElem, sFolder, sExcelFileName, sGroupSelected

sFolder             = "DriveName:\Folder\"
sExcelFileName      = "FileName.xlsx"
 
Set oMyDataFinder   = Navigator.ConnectDataFinder("My DataFinder")
Set oMyQuery        = oMyDataFinder.CreateQuery(eAdvancedQuery)
oMyQuery.ReturnType = eSearchChannelGroup
Set oMyConditions   = oMyQuery.Conditions
 
'--- Fill the query
Call oMyConditions.Add(eSearchFile, "folder", "=", sFolder)
Call oMyConditions.Add(eSearchFile, "fileName", "=", sExcelFileName)
oMyConditions.Logic = "C1 AND C2"
 
Call oMyDataFinder.SearchElements(oMyQuery, 20000)
Set oMyResults = oMyDataFinder.ResultsElements
 
for each oElem in oMyResults
  ' used to fill the combo box
  msgbox oElem.Name
next

' ....
sGroupSelected = oMyResults(2).Name

Call DataFileLoadSel(SFolder & sExcelFileName, "Mergeliste_import", sGroupSelected & "/*", "LoadImmediately|ChnXYRelation")

 

Greeting

Walter

0 Kudos
Message 3 of 3
(1,018 Views)