An option to Auto Split the List

Hello,

I am not sure if this is already possible or not, hence asking.

One of the most boring thing I feel is to split the list (e.g. comma separated clipboard values) and then assing key to all such values (example below)
image

Is there a way you can give an option to auto split this and auto assign key to each of the values? And also give a list of Values to be included or not (similar to this Read Space)
image

So that we can directly map values the desired place instead of creating keys for each of values.

Hi @Pratik_Shah.

Unfortunately, there's no way to do that other than assigning each entry to a variable, like you did in your example.

One note here, I see you're using the following syntax: {v1={=list}[1]}:

{list=split({clipboard}, ",")}
{v1={=list}[1]}

No need to nest that list inside a separate formula, you can just use {v1=list[1]} like this:

{list=split({clipboard}, ",")}
{v1=list[1]}

1 Like

Thank you.
Do you think that is possible for you guys to implement? Once the list is ready, I can click on that list and some button or action which splits each of the values which adds a keys to each value?

Thanks

Hey Pratik! I have created a repeat-command that I've used for generating multiple variables.
I edited it a bit to fit your use-case.

You just run this once and copy what it generates. You need to remove the last "," , for the second repeat, but this has saved me a lot of time.

I hope you find this useful :slight_smile:

{listboard=split({clipboard}, ",")}
{repeat: for x in listboard; locals=listboard1}{v{=location(listboard, x)}={{=trim( "=listboard")}}[{=location(listboard, x)}]}
{endrepeat}
{vs{=trim( "=concat")}({repeat: for x in listboard1}v{=location(listboard1, x)}, ",",{endrepeat})}

2 Likes

Another version so its visible in preview

{clipboard="Here are, some other, things you, can use, to style, your snippets"}
{listboard=split(clipboard, ",")}
{repeat: for x in listboard; locals=listboard1}{v{=location(listboard, x)}={{=trim( "=listboard")}}[{=location(listboard, x)}]}
{endrepeat}
{vs{=trim( "=concat")}({repeat: for x in listboard1}v{=location(listboard1, x)}, ",",{endrepeat})}

Amazing man! Thank you so much.

I thought of doing it earlier but then I actually realised it would best if there is a possibility of having it as native feature.

1 Like