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 / Can't create expressio...
Power Automate
Answered

Can't create expression with dynamic content within Apply to Each

(0) ShareShare
ReportReport
Posted on by 173

Does anyone know why I'm getting errors trying to create an expression within an Apply to Each loop?  

remariu_1-1673552592702.png

 

Here is the expression I am using:  

if(items('Apply_to_each')?['FormType/Value'] = null, 'standard', items('Apply_to_each')?['FormType/Value'])

 

I know I have created expressions successfully in the past using dynamic content, but this particular application has baffled me.

 

Thanks,

Renee

 

Categories:
  • Verified answer
    Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Hi @remariu 

     

    You can't use " = " in an if statement in Power Automate, you'll have to write the expression like this: 

     

    if(equals(items('Apply_to_each')?['FormType/Value'],null),'yes','no')
     
    Heartholme_0-1673553888979.png
     
    { If my post answered your question, please Accept it as a solution ✔ }
    { This will in turn help others find solutions to similar questions }

    Best Regards
    Heartholme
  • remariu Profile Picture
    173 on at

    I could have sworn that was the first expression I had tried.  Whatever happened between then and now, it's working.  So thank you!

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    @remariu 

     

    Just as a wee note, you've also got coalesce().  It returns the first non null value in a list.

     

    coalesce(items('Apply_to_each')?['FormType/Value'], 'standard')

     

    @Pstork1 taught me that one 18 months ago and I haven't looked back since.

     

    Damien

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 307 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 127

Last 30 days Overall leaderboard