How to convert a list to a string or use the input of a use to filter elements

Hi everyone ! I’m creating a script to convert areas into rooms, the way it works is selecting all of the areas modeled in the project, selecting the correct ones by filtering them using a parameter created by me (OPTION_SURFACE), then getting the location, level and name of those areas and afterwards creating the rooms using the node Room.ByLocation.

All of that works great! BUT, I want to make it easier for the users at my office to run the script by creating a UI that ask them to simply select the correct OPTION_SURFACE and it’s done.

The issue is that the result of the User Input is a list instead of a string, which is what I’m using to filter the areas.

Is there a way to convert the list given by the User Input to a string acceptable by my filtering nodes? or, is there a better way to filter my areas that would accept the result given by the User Input?.. I hope what I’m asking makes sense, I tryed looking online, but I couldn’t find an answer anywhere.

Here is the complete script in case it helps.

Thank you beforehand for all of your help.

Use a code block with x[0] to convert the list to a single item.

Also just to help, there is some redundancy with your graph. You are doing this function twice.

1 Like

Hello
try this in your codeblock
a+""; then plug between User Inputs and your node!=
edit: or this node
image

Cordially
christian.stan

Thank you very much! The code block with x[0] did the trick! Also, thanks for pointing out the redundancy on my script! I’m new to dynamo and every advise helps!

1 Like