AnsweredAssumed Answered

PDM API search for blanks

Question asked by David Watkins on Aug 9, 2018
Latest reply on Aug 10, 2018 by David Watkins

I am working on a test for a search tool and have a need to search for items that have blank (nothing, empty, or null) variables. With the below I would like to get only files that have blank for Hinge Qty but right now I get all files, regardless of there value. any way around this?

 

Sub SearchForFileVariable()

Dim MYarray(2, 2) As String

 

Set Search = Vault.CreateSearch

MYarray(0, 0) = "Description"

MYarray(0, 1) = "REAR FRAME ASSY"

MYarray(1, 0) = "Door Type"

MYarray(1, 1) = "ROLL-UP"

MYarray(2, 0) = "Hinge Qty"

MYarray(2, 1) = ""

i = 0

Do While i < 3

Search.AddVariable MYarray(i, 0), MYarray(i, 1)

i = i + 1

Loop

 

FindFiles = True

Search.FindFolders = False

Search.SetToken Edmstok_AllVersions, False

Set Result = Search.GetFirstResult

End Sub

Outcomes