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](https://community.blaze.today/uploads/default/original/2X/3/318dc77f5e1fde81e230332c9aa2e398df7bb2ce.png)
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](https://community.blaze.today/uploads/default/original/2X/2/248ee78762a9da8aa7d155019053f6e314e1bafa.png)
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: :slight_smile:](https://community.blaze.today/images/emoji/twitter/slight_smile.png?v=12)
{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