2

Value list 1:

1 lista 2 listb 3 listc 4 listd

Value list 2:

a energy b freeze c baby d apple

If I select 1 from list one then only a is available within list 2.

from psdi.mbo import MboConstants

list = mbo.getString("LISTONE")
if list == "lista":
Nenna Anya
  • 67
  • 7
  • 1
    Welcome to Stack Overflow. You might get better responses if the quality of your question was better. For example, your question should be in the body of the question, and the title of the question should be more concise. Then, in the body, you should include a [example]. As it stands, it looks like you're asking for free consulting to finish the script you started. That said, there are a number of ways of doing this kind of thing with plain Domains. Have you tried that? – Preacher Sep 11 '20 at 20:19

1 Answers1

1

What you need is feasible using Python lists, available also in Jython. After creating a temporary list, you can find your corresponding value using different types of indexes.

from psdi.mbo import MboConstants

valueList = []
valueList.append([1,"lista","a","energy"])
valueList.append([2,"listb","b","freeze"])
valueList.append([3,"listc","c","baby"])
valueList.append([4,"listd","d","apple"])
# Transposing the matrix so that finding stuff becomes easy
valueListVert = map(list, zip(*valueList)) # list(map(list, zip(*valueList))) if using python 3

listOne = mbo.getString("LISTONE")

print(valueListVert[3][(valueListVert[1].index(listOne))]) # listOne = "listc" -> baby
print(valueListVert[2][(valueListVert[1].index(listOne))]) # listOne = "listb" -> b
print(valueListVert[3][(valueListVert[0].index(4))]) # -> apple