web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update sharepoint item...
Power Automate
Answered

Update sharepoint item with custom text if approval comment is left blank

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've got an approval flow that uses 'Start and wait for an approval'.  When the approver approves or rejects the flow the relevant sharepoint list is updated, including capturing the comment they might have added.

However, when an approver leaves the 'Add a comment (optional)' field empty rather then leaving the field empty I'd like to update the relevant sharepoint item with a default text, something like 'No comment added'.

 

Thought a simple expression like an if statement would do the trick but it doesn't allow me to.  Any suggestions on how to accomplish this?

 

 Capture.JPG

Categories:
I have the same question (0)
  • Gristy Profile Picture
    2,429 on at

    if(empty(body('Start_and_wait_for_an_approval')?['responses'][0]?['comments']), "No Comment", body('Start_and_wait_for_an_approval')?['responses'][0]?['comments']))

     

    Try something like this. May not be exactly correct syntax

     

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @Anonymous ,

     

    Please try to use the following configuration:

    9.PNG

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks - I've tried several variations on the code you suggested but it doesn't seemt to accept that.

    Might be somethign to with that if you select the 'Responses Comment' field it shows as 'Items(Apply_to_each)?['comments']' rather than the 'body('Start_and_wait_for_an_approval')?['responses'][0]?['comments']' you have used.   Also, as soon as I select an expression, the option to select 'Responses Comment' disappears from the list of dynamic fields to choose from.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, yes that works.  Ideally just adding an expression woud've been simpler but this works fine.  Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard