# Unable to print the CodeFresh variable in custom step

**URL:** <https://community.codefresh.io/t/unable-to-print-the-codefresh-variable-in-custom-step/742>\
**Category:** Pipeline Workflows\
**Created:** [March 6, 2022, 8:49am UTC](https://community.codefresh.io/t/unable-to-print-the-codefresh-variable-in-custom-step/742 "2022-03-06T08:49:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aswini\_Ray](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/aswini_ray/32/475_2.png) [@Aswini\_Ray](https://community.codefresh.io/u/Aswini_Ray)\
**Post date:** [March 6, 2022, 8:49am UTC](https://community.codefresh.io/t/unable-to-print-the-codefresh-variable-in-custom-step/742/1 "2022-03-06T08:49:50Z")

</div>

Custom step is unable to access CodeFresh variable if I use Golang templating. Below are the code snippet. The first line prints the variable value whereas golang templating is not printing the value. Is there any limitation?

```
    - 'echo "PULL Request Number is $CF_PULL_REQUEST_NUMBER"'
    - echo "PR Number is [[env.Getenv "CF_PULL_REQUEST_NUMBER"]]"

```

---

<div class="post-metadata">

**Author:** ![Oleg\_Sergiyuk](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/oleg_sergiyuk/32/442_2.png) [@Oleg\_Sergiyuk](https://community.codefresh.io/u/Oleg_Sergiyuk)\
**Post date:** [March 8, 2022, 1:35pm UTC](https://community.codefresh.io/t/unable-to-print-the-codefresh-variable-in-custom-step/742/2 "2022-03-08T13:35:49Z")

</div>

Hello,

Since shell executes given echo command, shell rules take place, Go templates are not recognized. To get variable value please use `$VAR` syntax. More information can be found [here](https://codefresh.io/docs/docs/codefresh-yaml/variables/).

---

<div class="post-metadata">

**Author:** ![laurent.rochette](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/laurent.rochette/32/329_2.png) [@laurent.rochette](https://community.codefresh.io/u/laurent.rochette)\
**Post date:** [March 12, 2022, 12:48am UTC](https://community.codefresh.io/t/unable-to-print-the-codefresh-variable-in-custom-step/742/3 "2022-03-12T00:48:04Z")

</div>

I"m not sure you’re using the correct syntax  
You can check the codefresh-run one in [GitHub - codefresh-io/steps](http://github.com/codefresh-io/steps). The syntax allows you to access steps variables

```auto
  delimiters:
    left: '[['
    right: ']]'
  stepsTemplate: |-
    first:
        image: quay.io/codefresh/cli
        commands:
        [[- $cmd := (printf "codefresh run \"%s\" -d" .Arguments.PIPELINE_ID ) -]]
        [[if .Arguments.TRIGGER_ID]]
            [[- $cmd = (printf "%s -t %s" $cmd .Arguments.TRIGGER_ID) -]]
        [[- end -]]

       <SNIP>

      [[/* Multiline string is required to support usage of 'colon' (:) character in the string. For example in the pipeline name. */]]
        [[/* Otherwise after template render there is a chance to have an object instead of a string. */]]
          - >-
            export BUILD_ID=$([[$cmd]]); if [-z "$BUILD_ID"]; then exit 1; fi
          - cf_export first_CF_OUTPUT_URL="${{CF_URL}}/build/$BUILD_ID"
          - cf_export BUILD_ID
      [[- if eq .Arguments.DETACH false]]

```

Hope that help
