yes it is possible. It took me some time to fix all variables and with help topics I was able to make this code. Thats why I want to share it. I do not know if it is optimal solution, but it works and it is fast enough.
'Field to filter
'Activate first bookmark
'Take possible values from field G_VCC into array
SET PrvaLista = araj.GetPossibleValues
'Activate second bookmark
'ake possible values from field G_VCC into array
SET DrugaLista = araj.GetPossibleValues
'Count length of both arrays
brojac1 = PrvaLista.Count
brojac2 = DrugaLista.Count
'loop throught both arrays. Goal is to check every line from first array with every line from second and to extract those that are same.
for i=0 to brojac1 - 1
'Set variable with "i" line from array1
set VCC1 = PrvaLista(i)
'Loop through second array
for j = 0 to brojac2-1
'Set variable with "j" line from array2
set VCC2 = DrugaLista(j)
'If value from first array is equal to value from second array
if VCC1.Text = VCC2.Text then
'Then result is previous result;NewVariable
Rezultat = Rezultat & PrvaLista(i).text & "; "
'At the end, result variable "Rezultat" is placed in previously created variable "Probna" in front end. There is textbox on frontend that takes variable "Probna"
ActiveDocument.Variables("Probna").SetContent Rezultat, true
Question 2: How to format data in textbox. Right now I get a list with Part;Part;Part... Is it possible to get:
But this issue is solved Thank you all, because I used other questions and answers to get this done.