Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can you concatenate two text fields together in another field?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
jdow
919 Views, 6 Replies

Can you concatenate two text fields together in another field?

This seems like it should be simple, but...

I'd like the value from Part_Number & PNIC to show up in another field like "Part Number-PNIC"

All of thse fields are single line text fields. These are all in the same workspace.

 

Also is there any "real" documenation on using the computed field fomula...like the syntax, etc.???

 

Thanks,

JD

JD
6 REPLIES 6
Message 2 of 7
dvirh
in reply to: jdow

Yes, you can certainly do that! You will need a Computed Field for that with the following formula (adjust it to add space paddings or other symbols as needed - simply use || to add another segment to the text, and quotes to add fixed text):

 

PART_NUMBER || PNIC

 

another example:

 

'Part Number : ' || PART_NUMBER || ' and pnic: ' || PNIC

Hagay Dvir
Engineering Manager
Fusion Manage
Autodesk, Inc.
Message 3 of 7
PLM-Sylvain.Bailly
in reply to: dvirh

Hi,

 

If the fields are picklists, how to obtain the value and not the unique ID?

 

For example,

I have 1 picklist (ID: PROJECT) with the following values: "titi", "tutu", "toto"

I have a second picklist (ID: ORIGINATOR) with the following values: "qw", "er"

I have created a third field which concatenate the field 1 with the field 2. I have defined it as a computed field with the following code: 

PROJECT || ' - ' || ORIGINATOR

 

If I create an object with field 1 = "tutu" and field 2 = "er".

Instead of returning: tutu - er

It returns: 3 - 2

 

I suppose that the numbers are the unique ID of the values in the different picklists. How is it possible to return the value?

 

Thanks,

Sylvain

Message 4 of 7

The internal ID is used for picklists with fixed values.

So, you will need to create logic to interpret the values.

Message 5 of 7

How "create logic"? What does it mean? Where? in the computed field?

Message 6 of 7

Or instead of using a computer field,use a read only single line text field,and populate this based on the values of other fields. 

 

Eg create a script, set it as an on create and on edit script for your workspac.

 

 

 

Then use a piece of trivial logic like this:

 

item.F3 = item.PART_NUM + '-' + item.ANOTHER_FIELD;

 

This will handle picklists automatically.

 

The above script is trivial JavaScript.  

 

BTW your original question about computed fields,the language there is.SQL. If you Google for PostGres SQL there are plenty of examples. 

If you want to extract a value from a picklist you need to turn the index integer into a string, either with a Case statement or perhaps using a split function. But you will need to adjust your formula whenever the picklist definition changes.

Hence the JavaScript example might be easier than a computed field whenever you have a picklist as one of the fields. 

 

You also have more flexibility with JavaScript. For example if your second field had an empty value and you  wanted to skip the delimiter when so, this much easier and supportable in JavaScript . 

Message 7 of 7

Thank you Tony and Philip. I will create an example using the script. It is easy to do and to maintain.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report