Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Building an array however not selecting the values that are null

Here is my flow and it works great.  It's an global address book for our team bot.  Use if you want however the o365 address book has multiple users that I don't want to get in the array.  Example:


so my search term in this example is 'joe'.   I want to exclude anything that has nothing (like "Joe Charlie (O365 Admin)") - if the account don't have an email then I want to exclude them all together and if I can exclude a single value like "Joe Beta" phone because it's null on the O365 address book..  I am having issues trying to do that, any thoughts?  



joe alpha (jalpha)
  - city
  - [111.222.3333]
  - 01.01 headquarters

joe beta (jbeta)
  - city
  - []
  - 01.02 headquarters

joe charlie (O365 Admin) (joe_charlie)
  - []

joe charlie (jcharlie)
  - city
  - [111.222.5555]
  - 01.03 headquarters







Here the concatenate from the array to a string, if you want to recreate it:


concat('##### ',body('Get_user_profile_(V2)')?['displayName'],' (',body('Get_user_profile_(V2)')?['mailNickname'],')',variables('newLine'),'- ',body('Get_user_profile_(V2)')?['mail'], variables('newLine'),'- ',body('Get_user_profile_(V2)')?['city'],variables('newLine'),'- ',body('Get_user_profile_(V2)')?['businessPhones'],variables('newLine'),'- ',body('Get_user_profile_(V2)')?['officeLocation'],variables('newLine'),variables('newLine'),variables('newLine'))



Helper I
Helper I

Any ideas?  basically I want to have an if then statement but I am but sure how do that with the array 

Dual Super User III
Dual Super User III

Take a look at the Data Filter Array action.  It provides a condition statement that can be applied to each record to filter rows out of an array.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

PVA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Center-of-Excellence-Starter-Kit-cropped 768x460.png

The Total Economic Impact™ of Power Virtual Agents

Read this 2021 commissioned study, conducted by Forrester Consulting.

Top Solution Authors
Top Kudoed Authors
Users online (1,790)