Store value from a list in variable

0
Hello, I want to store a parameter of a list in a variable. When I use the action "create variable" and want to specify the value "listname/value" I get the error: Variable listname has no members as it is not of type object.  How can I save the value of a list in a variable?
asked
2 answers
0

A list can contain several objects(or no object, or exactly 1 object), hence you cannot directly access a value from a list. If you have exactly 1 object in your list, you can use the list operation Head to get the object from your list; then you can get the value from the object. If you have multiple objects, you might want to use list operation Find. You can learn more about list operations here:

https://docs.mendix.com/refguide/list-operation/

 

answered
0

Hey Sophia!

If you want to create a variable of a list you should use a create a list action. Create a variable is for these types.

I don’t understand exactly why you need a variable but you can create a list a do a change list to add the parameter list. 

 

If this doesn’t answer your question please let me know.

 

Thanks in advance

answered