Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

How to add single quote in an expression

Like (0) ShareShare
ReportReport
Posted on 18 Aug 2022 16:50:33 by

Hi all,

 

I am building an expression. So that when triggerBody()['text_1'] is null, it should return null (no quote). If it has value (e.g. value), it should return 'value' (with single quote). How can I do it? The Power Automate builder keep prompting for "The express is invalid".

 

if(empty(triggerBody()['text_1']),'null',''triggerBody()['text_1']'')

  • Verified answer
    MF-12051538-0 Profile Picture
    398 on 18 Aug 2022 at 17:22:02
    Re: How to add single quote in an expression

    Hi @Anonymous ,

    To get single quotes to appear you'll have to use four quote marks in a row (i.e. ''''). Additionally, you'll need to concatenate them together instead of just placing them before and after the triggerBody()['text_1'].

    Try this code:

    if(empty(triggerBody()['text_1']), 'null', concat(concat('''',triggerBody()['text_1']),''''))


    If you found this post helpful, please consider Accepting it as the solution.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 103

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 60 Super User 2025 Season 1

Overall leaderboard
Loading started
Loading started