Get User Email Address with the Search for Users (V2) Action | Scribe

Get User Email Address with the Search for Users (V2) Action

  • A Creative Opinion |
  • 0 step |
  • 39 seconds
    **TIP**: \ Start with a **manual trigger** when building for MS Forms. This saves time by letting you test without leaving Power Automate to submit a form. When your flow is ready to go, replace the manual trigger with the automated trigger. Keep the manual flow as a troubleshooting tool for quick adjustments later.
    Add a **Search for Users (V2)** action. Search for the dynamic content of the MS Form question that contains the search term. In this case, it's a name.
    **T**his action performs a partial, case-insensitive search across user properties. Ensure the dropdown options are unique or add additional steps to your flow to verify the correct match for accuracy.
    Run a test.
    Review the outputs of your flow.
    Add a **Compose** action to your flow. This step is optional, you can insert the expression used in subsequent actions. However, I prefer to use **Compose** actions in my flow to help with troubleshooting. It also streamlines the flow building process if I have to use the output in subsequent actions of my flow.
    **TIP:**\ Rename your actions to keep your flow organized!
    The **Search for Users (V2)** action will always output an array of items (even if it's a single item). When you try to insert the **Email** dynamic content into the **Compose** action, the **Compose** action will nest itself inside an **Apply to Each** action. Since you only want to output a single email, you will need to use an expression to avoid the Apply to Each action.
    To learn more about the Apply to Each action—check out this YT Tutorial: [3 Mistakes YOU 🫵 are Making with the Apply to Each Action in your Microsoft Power Automate Flow](https://www.youtube.com/watch?v=44Bk4JVMrD4&list=PLphkuAZNVjJCpyWAXs2DJWKo-K7i9tJFL&index=12)
    Click on the **three dots** of the **Compose** action and select **Peek Code**.
    Highlight the question mark and the content just before the closing double quote marks and **copy it to your clipboard**. In this case it's: [[?\['Mail\\]]\]
    Remove the **Email** dynamic content from the **Compose** action by clicking on the 'x' of the dynamic content label. Drag the **Compose** action outside of the **Apply to Each** action.
    Delete the **Apply to Each** action.
    Insert an **Expression** in the **Compose** action.
    Paste the content from your clipboard. Insert your cursor just after the question mark.
    An array is a collection of items. The first item in an array is 0, second is 1, third is 2 and so on. Since we want to return the first item of the array, we'll need to specify the index. In this case it's 0. Insert a zero between square brackets. Click on the **Dynamic Content** tab.
    Place your cursor at the start of the expression by pressing the **Up Arrow Key**.
    Press **OK**.
    Run a test.
    Review the output of the **Compose** action.
    This Scribe is in tip-top shape!Leave feedback if there are any issues with this Scribe