Concat not working

hello, I am trying to concat two parameter values from an element with each other but I am having trouble. First I want to concat two parameters a prefix and a number from each element in a selection set and send that value along with two other parameters to an excel file. I want the excel file to only have 3 columns but have the info from 4 parameters, and I need to make sure that each row of values comes from the correct corresponding element. I did it the way I think it should work but the concat node is choking on me. Why? and how do I fix it? Thanks!

The string.concat node only accepts strings. Try this in a code block:

Prefix+(Num+"")

1 Like

@mix Using nodes you could try this …

1 Like

@jacob.small thats slick! That worked in the first try how does that work exactly thought? I dont understand what is going on there. I thought the β€œβ€ was an empty set? and why is the Num variable in parenthesis?

@Vikram_Subbaiah Thats good! The only thing I would have to add though is even though my numbers are coming out of a text parameter, I still had to convert them to strings to get your method to work for me. But it works!

β€œβ€ in design script is an empty string, not a null value. They are similar but different in that I can do stuff with an empty string that I can’t do with a null.

Joining an empty string to a number in desginscrpt makes The number into a string. Check out the primer and the designacript language guide to learn more.

1 Like

True, but want to point out that the empty string is unnecessary, if you are already adding a string to the number.

In this case Prefix(string) + Num(number) would work just as well
20170922-6

2 Likes

Good catch Vikram!

1 Like