String Concatenation

5919
4
Jump to solution
04-02-2013 10:10 AM
EricStarn2
New Contributor
Hello All,

I am just wondering if you can Concatenate two String data elements together in model builder and how you might do that?

Thanks

Eric
0 Kudos
1 Solution

Accepted Solutions
DaleHoneycutt
Occasional Contributor III
If I understand the problem, it's really easy to solve.
See attached.
Basically, you create two string variables (Year and Type).  Both these variables would be model parameters.  You could set a value list filter on these two parameters.

You then use Calculate Value with the expression "%Year%%Type%" with the output type set to String.
[ATTACH=CONFIG]23152[/ATTACH]

View solution in original post

0 Kudos
4 Replies
JoelCalhoun
New Contributor III
Can you be a little more specifc?  Are you wanting to concatenate two String attribute fields together?
0 Kudos
DaleHoneycutt
Occasional Contributor III
See this blog post on concatenating field values. This is if you're concatenating field values.

If you want to concatenate two string data elements in ModelBuilder, in-line variable substitution may be what you want.
0 Kudos
EricStarn2
New Contributor
Hopefully this is more specific

What I have or what I would like to do is join two strings together to create a new variable.

In my model I have the Calculate Value tool testing a string value coming in to model to determine which branch to run.

I would like to have two different inputs coming "Year" and "Type"

Attached is my model with a graphic representation of the string elements.

I hope this helps

Eric
0 Kudos
DaleHoneycutt
Occasional Contributor III
If I understand the problem, it's really easy to solve.
See attached.
Basically, you create two string variables (Year and Type).  Both these variables would be model parameters.  You could set a value list filter on these two parameters.

You then use Calculate Value with the expression "%Year%%Type%" with the output type set to String.
[ATTACH=CONFIG]23152[/ATTACH]
0 Kudos