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 / Search for users, retu...
Power Automate
Answered

Search for users, return first business phone or first result

(1) ShareShare
ReportReport
Posted on by 179

Hello!

I try to use the search for users action and I want to get the first business phone of the first result only. I would prefer to avoid getting a for each. I tried a lot of different way to type an expression to get it with no success. I tried other values as well such as Mail with no success either...

Volt26_0-1705955757616.png


I get this error :

Volt26_1-1705955779195.png

 



Can you help me out please?

 

 

Categories:
  • Verified answer
    creativeopinion Profile Picture
    10,508 Moderator on at

    @Volt26 The first() function should be used with the value dynamic content returned from the Search for users (V2) action.

    creativeopinion_0-1705957382942.png

    When you run a test, it'll return the first user.

    creativeopinion_1-1705957408844.png

    From that you can adjust your expression and add:

    ?['BusinessPhones']

     

    creativeopinion_2-1705957488934.png

     

    Run a test.

    creativeopinion_3-1705957500017.png

     

    Take a look a this YT Tutorial I recently uploaded: 3 Mistakes YOU 🫵 are Making with the Apply to Each Action in your Microsoft Power Automate Flow

    In this video tutorial I’ll go over how to avoid these common mistakes when using the Apply to Each action in a Power Automate flow:

    1️⃣ Looping through a Single Item

    2️⃣ Creating Unnecessary Nested Loops

    3️⃣ Looping through an Unfiltered Array

    At the end of the video I share a few helpful insights when it comes to using the Apply to Each action in your flow.

    I'll also cover:

    ✅ How to avoid the Apply to Each action with a single item array

    ✅ How to use the item() function to access dynamic content in an array

    ✅ How to prevent unnecessary nested Apply to Each action loops

    ✅ How to use the Select action

    ✅ How to convert an array to a string with the Select action

    ✅How to use the Filter Query field

    ✅ How to count the number of items in an array

    ✅ How to use a condition control

    ✅ How to use the concurrency control

    ✅ How to set a top count

    ✅ How to use Compose actions for troubleshooting

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ☕️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

  • Volt26 Profile Picture
    179 on at

    Thank for the reply. My formula is :
    outputs('Search_for_users_(V2)_2')?['body/value']?['BusinessPhones']

     

    I see a part of yours with a ")" after ['body/value']. Where is the beginning of the parenthesis? I'm looking at your video right now so maybe I will find the answer there but while watching I thought I should ask here just in case. 

  • Volt26 Profile Picture
    179 on at

    I'm not done with your video but I found the answer at 2:45

    Here is the formula that returns the first business phone of the first user found :

    outputs('Search_for_users_(V2)')?['body/value']?[0]['BusinessPhones'][0]

     

    Thank you very much!

  • mickyb23uk Profile Picture
    50 on at
    Would it be possible to get the images fixed on this post?
    I'm having the exact same issue but I can't understand what video you're referencing or the broken screenshot links below.
     
    I'm running this but every row returns N/A when there is a BusinessPhone value present.
     
    if(empty(items('Apply_to_each')?['body/businessPhones']?[0]),'N/A',
        first(items('Apply_to_each')?['body/businessPhones']?[0])
    )
     
     

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
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard