Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

toUpperCase in Workflow code

BrianToussaint
19-Tanzanite

toUpperCase in Workflow code

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.

ACCEPTED SOLUTION

Accepted Solutions

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();

View solution in original post

3 REPLIES 3

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.

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();

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

Announcements



Top Tags