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.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 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…

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 385 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 320

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 1

Overall leaderboard
Loading started
Loading started