Skip to main content
19-Tanzanite
April 7, 2025
Solved

toUpperCase in Workflow code

  • April 7, 2025
  • 2 replies
  • 664 views

Version: Windchill 12.1

 

Use Case: Due to contains being case sensitive, I need to change a string variable to UPPER CASE


Description:

How do you program in a workflow to make a string variable UPPER CASE in a new variable?  I cannot get toUpperCase to work.  Any insights would be appreciated.

Best answer by avillanueva

Hey @BrianToussaint , you are looking to display the variable in upper case or are you looking to save the variable to upper case? Let's see what you have for this variable. Transition code might be an option. toUpperCase() creates a new String for its return which would leave the original String unaffected. If you are looking to change the value, you might have to write it back to itself:

stringVariable=stringVariable.toUpperCase();

2 replies

Community Moderator
April 8, 2025

Hi @BrianToussaint

Thank you for reaching out with your question.

To assist you better, could you please provide more details and context regarding your inquiry? Specifically:

 

  1. Which specific workflow are you working on in Windchill 12.1? 
  2. Can you share the snippet of code where you're trying to use toUpperCase? 
  3. Are you encountering any error messages or unexpected behavior when using toUpperCase? 
  4. Have you tried logging the intermediate steps to see where the issue might be occurring? 

Including screenshots can also be very helpful in understanding your process. This will enhance the likelihood of receiving valuable assistance from other Community members.

You might also find it useful to refer to the guide on how to ask a good question. Additionally, our community champion has shared tips on key points to include when asking a question on the PTC Community.

I hope this information is helpful.

Best Regards,
Vivek N
Community Moderation Team.

avillanueva
23-Emerald I
23-Emerald I
April 8, 2025

Hey @BrianToussaint , you are looking to display the variable in upper case or are you looking to save the variable to upper case? Let's see what you have for this variable. Transition code might be an option. toUpperCase() creates a new String for its return which would leave the original String unaffected. If you are looking to change the value, you might have to write it back to itself:

stringVariable=stringVariable.toUpperCase();
19-Tanzanite
April 9, 2025

Hey @avillanueva , thank you! I was not getting the syntax correct.