# Pending Approval notification

**URL:** <https://community.codefresh.io/t/pending-approval-notification/809>\
**Category:** Pipeline Workflows\
**Created:** [June 21, 2022, 9:27am UTC](https://community.codefresh.io/t/pending-approval-notification/809 "2022-06-21T09:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheMck](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/themck/32/515_2.png) [@TheMck](https://community.codefresh.io/u/TheMck)\
**Post date:** [June 21, 2022, 9:27am UTC](https://community.codefresh.io/t/pending-approval-notification/809/1 "2022-06-21T09:27:19Z")

</div>

Hi, I was wondering if anyone could help with some functionality?  
I’ve had a quick look in the forum and online but couldn’t see anything related to what we are trying to do.

Basically, on the `pending-approval` step. You have an output like `Step has been approved by: some-name` What I’d like to do is pass that name to a slack message in the next step. Is this even possible?  
Thanks

---

<div class="post-metadata">

**Author:** ![Alexander\_Mankinenko](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/alexander_mankinenko/32/437_2.png) [@Alexander\_Mankinenko](https://community.codefresh.io/u/Alexander_Mankinenko)\
**Post date:** [June 22, 2022, 9:56am UTC](https://community.codefresh.io/t/pending-approval-notification/809/2 "2022-06-22T09:56:49Z")

</div>

Hey!

Yes, this is possible by using the [Step Member Variables](https://codefresh.io/docs/docs/codefresh-yaml/variables/#step-member-variables), the Approval step have the following variables exposed:

- authEntity.name
- authEntity.type

So you can get the name in the following step by using this variable: `${{<Approval_step_name>.authEntity.name}}`

---

<div class="post-metadata">

**Author:** ![TheMck](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/themck/32/515_2.png) [@TheMck](https://community.codefresh.io/u/TheMck)\
**Post date:** [June 22, 2022, 1:25pm UTC](https://community.codefresh.io/t/pending-approval-notification/809/3 "2022-06-22T13:25:20Z")

</div>

Thats brilliant thanks. I did spot those vars elsewhere but didn’t realise they were members of that step 👍

---

<div class="post-metadata">

**Author:** ![Elisha](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/elisha/32/522_2.png) [@Elisha](https://community.codefresh.io/u/Elisha)\
**Post date:** [July 7, 2022, 3:26pm UTC](https://community.codefresh.io/t/pending-approval-notification/809/4 "2022-07-07T15:26:22Z")

</div>

Hi I’m trying to do this too but I can’t seem to get it to work. Any suggestions? Thanks!

My pipeline looks like this:

```auto
version: 1.0

steps:
  askForApproval:
      type: pending-approval
      title: Deploy to production?
      fail_fast: false
      timeout:
        duration: 2
        finalState: denied
        timeUnit: hours
        
  ifApprovedSendSlackNotification:
    type: slack-post-channel
    arguments:
      SLACK_TOKEN: "${{SLACK_TOKEN}}"
      SLACK_CHANNEL: "#elisha-test"
      SLACK_MESSAGE: "${{askForApproval.authEntity.name}}"

```

But my slack message shows: `${{askForApproval.authEntity.name}}`

I also tried with `SLACK_MESSAGE: "${{steps.askForApproval.authEntity.name}}"` but again my slack message is: `${{askForApproval.authEntity.name}}`

Thanks!

---

<div class="post-metadata">

**Author:** ![TheMck](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/themck/32/515_2.png) [@TheMck](https://community.codefresh.io/u/TheMck)\
**Post date:** [July 8, 2022, 7:19am UTC](https://community.codefresh.io/t/pending-approval-notification/809/5 "2022-07-08T07:19:41Z")

</div>

We got ours working well. Here’s a snippet of the code we’ve used. We are exporting the variable to send to another pipeline, but in essence what you’ve used in `${{steps.askForApproval.authEntity.name}}` should work I would say.

another test would be add a step like the below but with the command ` - echo ${{steps.askForApproval.authEntity.name}}`

```auto
deploy_uat_by:
    stage: deploy-to-uat
    type: freestyle
    title: UAT Approval
    image: "gradle:7-jdk11-alpine"
    commands:
      - export UAT_APPROVER=${{steps.approval_to_deploy_uat.authEntity.name}}
      - cf_export UAT_APPROVER

```
