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 / Help with if expression
Power Automate
Answered

Help with if expression

(0) ShareShare
ReportReport
Posted on by 9

Hi all,

 

I'm trying to create an incrementing Purchase Order ID column using a Sharepoint List ID column, but with a dynamic reference based on the contents of another field. I have the basics working, I am just struggling with it thrown an invalid expression error when I try to combine fixed text with dynamic content in the true/false sections. The trigger expression works fine and I can insert just text, or just dynamic content, but not the combination of the 2. Here's my Expression that works:

 

if(contains(body('Get_response_details')?['r73b853f618344ce0aea8f1b84896c719'], 'Credit Card/ One Off Payment'), 'IT_CC_00', 'IT_00')

 

 

 
and here's what I'm trying to do to combine the static and dynamic content:
 

if(contains(body('Get_response_details')?['r73b853f618344ce0aea8f1b84896c719'], 'Credit Card/ One Off Payment'), 'IT_CC_00' & body('Create_item')?['ID'], 'IT_00' & body('Create_item')?['ID'])

 

I'm missing something significant around the & symbol in there and I don't know the syntax needed to correct this.  

 

Anyone able to point out my flaw?

Categories:
  • Verified answer
    promithius Profile Picture
    9 on at

    Well, I've solved my own problem! I am not sure I did this in the most effective way, but by using concat I have it working:

     

    if(contains(body('Get_response_details')?['r73b853f618344ce0aea8f1b84896c719'], 'Credit Card/ One Off Payment'), concat('IT_CC_00', body('Create_item')?['ID']), concat('IT_00', body('Create_item')?['ID']))

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 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard