How to guarantee integer is parsed as string in props

I have a Tree component in Perspective with a JSON structure where each subtree is labelled with its index.

The selection parameter in the Tree component controls which subtree is clicked during the Perspective session. This parameter selects the subtree by containing the subtree's index (ex. selection: 0/0/1/0.)

I want to add an onStartup event to the Tree component that automatically selects the root of the Tree component by setting selection:0, where 0 is a string, since selection can only accept strings as values. However, when the event sets selection: 0, Ignition immediately assumes that 0 must be an integer, which throws an error on the selection property (integer found, string expected.)

How can I get the props on the Tree component to accept 0 as a string? I've tried self.props.selection[0] = '0' and self.props.selection[0] = str(0) in the onStartup script, but Ignition seems to immediately register 0 as an integer.

I am not seeing the same issue on my end. If I add a tree with a startup script that sets self.props.selection[0] to either the string literal or 0 casted to a string it seems to work fine and treat the value as a string.

I only get the error you are describing when I set the value as an integer.

Just in case it is an issue that was fixed I am on version 8.1.39

Wherever selection is being used, can you cast it to string there to get rid of the type error?