I am trying to return a list, the items of which are also smaller lists. As you can see in the screenshot, I attempted to return the parent list with only one child (the name "Stewie" and 3 roles, each with the value of "1"). However, when I try displaying this in a list, the widget doesn't show up. I debugged it and found the attached image's results, which clearly shows that the values are there, but the parent list says that empty is true and that the length is 0. I'm not sure how to fix this or get it to show up.
This is expected behaviour.It seems you are confused with Current property of List.
Usually we use Current in For Loop to get / assign value of current element of the List.If we use Current without For Loop, then it is the First element of List.If it is an empty List, then Current is just an empty element.About your issue, even you assign value to Current.Play, List itself are still empty List.So you need 1. Define an PlayerWithThreeRoles Type Variable Element2. Assign value to Player of Element3. Add Role to Element4. Append Element to List.
RegardsWei
Thank you! This fixed it and is returning what I wanted.
Following this, I have one more question. As you might have seen in the OML, I'm passing the Role Identifier in the Roles list, which is why it's returning three "1"s. I'm storing these values in an entity, but I'm currently serializing the three values because I can't figure out how to input them to the CreatePlayersWithRoles action in RandomizeRolesOnClick. I would like to create an aggregate with these roles, but when they're serialized, I can't compare them to another entity. Is there another way I can assign these three roles to CreatePlayersWithRoles so that they're all assigned to a different entity attribute?
Attached is the updated OML file.
hi @joseph,
are there any other attributes in the main list other then name and roles?
if possible can you share the OML?
Regards,
Jozy.
It's just name, and a list of roles.
OML is attached. Thank you!