Calm Macro Operations | Nutanix Community
Skip to main content

Does any one know the syntax to get the first 3 characters of the project name ?  The documentation is not clear.  It talks about support for slicing for strings. For example, @@{foof3:6]}@@, but it doesn’t seem to work.

Hi BCar,

Thanks for pointing this out. A ticket has been filed to fix this. In the interim you could use the following workaround:

  1. Create a pre-create task type Set Variable - EScript
  2. As code
    project_name='@@{calm_project_name}@@'
    print('PROJECT_NAME={}'.format(project_name[3:6])) # slice here

     

  3. Output PROJECT_NAME
  4. Use @@{PROJECT_NAME}@@ instead of @@{calm_project_name}@@ for naming convention