HPE Morpheus Enterprise Software
1856345 Members
8072 Online
104111 Solutions
New Discussion

Create Option list for Python Task

 
Not applicable

Create Option list for Python Task

I want to create a options list for python task which should be “List” based options list ,
Using Get method
1.i need to get the lists and pass to an enduser when he submittes workflow or catalog

2.I dont see any option to pass these option list to Python task

I get this error when i pass option list in workflow


5 REPLIES 5
KoreyG
HPE Pro

Re: Create Option list for Python Task

Sorry @Paul_B, that was my fault on the information I provided. My mind glanced over the Python portion.

I updated my post with better information. I hope it helps.

Not applicable

Re: Create Option list for Python Task

i already used “<%= customOptions.PoolSelectionManual %>” , it needs to be an integer but anyway both are not accepting by system

cbunge
HPE Pro

Re: Create Option list for Python Task

You may have to do
int("morpheus['customOptions']['PoolSelectionManual']")
but how @kgawronski wrote the var is how we pass them into Python. (Assuming your input fieldName is “PoolSelectionManual”.

KoreyG
HPE Pro

Re: Create Option list for Python Task

Hello @Paul_B,

Using your example I see in the error, I’d expect it to be:

morpheus['customOptions']['PoolSelectionManual']

Similar example:
data = {"ldevId": None, "poolId": morpheus['customOptions']['PoolSelectionManual']}

That should remove the error from the syntax checker. All variables in Python are put in the morpheus variable.

Additional info on the different syntax based on the language:
https://docs.morpheusdata.com/en/latest/troubleshooting/Variables_Examples.html#syntax-examples

Not applicable

Re: Create Option list for Python Task

Hi , I get below error after trying your suggestion

Traceback (most recent call last):
File “”, line 11, in
KeyError: ‘Pool_Selection_Manual_Text’

Its my code
data = {“ldevId”: None, “poolId”: morpheus[‘customOptions’][‘Pool_Selection_Manual_Text’], “byteFormatCapacity”: morpheus[‘customOptions’][‘ByteFormatCapacity’]