cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ashwinreddy
Microsoft
Microsoft

Adding multiple field titles in one

Hi Team,

 

I'm  trying to achieve an scenario where there are 5 different fields with different name for example A,,B,C,D,E,F and they are Boolean valued

now I want to send email where there will be title as XYZ and if any of the field value is true then it should be appended under XYZ if not the email should be null as shown below if A and B was selected as true then in email XYZ= A,B

can I get the solution for this please

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Ashwinreddy :

I've made a test for your reference:

My flow:

I set an object type variable "TheVar" to simulate the situation you describe.

vbofengmsft_1-1624522143655.png

Reference Expression:

concat(
  'XYZ=',
  if(variables('TheVar')['A'],'A',''),
  if(variables('TheVar')['B'],'B',''),
  if(variables('TheVar')['C'],'C',''),
  if(variables('TheVar')['D'],'D',''),
  if(variables('TheVar')['E'],'E','')
)

The Result:

vbofengmsft_0-1624522112765.png

Best Regards,

Bof

 

View solution in original post

3 REPLIES 3
PrasadAthalye
Super User
Super User

You can declare a string variable and then add conditions to check if each boolean field is true or not. If yes, use append to string variable action and append field name. 

 

Finally add a condition to check if string variable is not empty. If not empty, send email and add string variable.

 

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
v-bofeng-msft
Community Support
Community Support

Hi @Ashwinreddy :

I've made a test for your reference:

My flow:

I set an object type variable "TheVar" to simulate the situation you describe.

vbofengmsft_1-1624522143655.png

Reference Expression:

concat(
  'XYZ=',
  if(variables('TheVar')['A'],'A',''),
  if(variables('TheVar')['B'],'B',''),
  if(variables('TheVar')['C'],'C',''),
  if(variables('TheVar')['D'],'D',''),
  if(variables('TheVar')['E'],'E','')
)

The Result:

vbofengmsft_0-1624522112765.png

Best Regards,

Bof

 

View solution in original post

You should not add anything inside else part .. refer below

 

Something like below.. Please ensure that closing brackets match...

 

concat(
'XYZ=',
if(variables('TheVar')['A'],'A',
if(variables('TheVar')['B'],'B',
if(variables('TheVar')['C'],'C',
if(variables('TheVar')['D'],'D',
if(variables('TheVar')['E'],'E','')))))
)

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Kudoed Authors
Users online (3,142)