Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

How to select specific values from an array in Power Automate

Posted on February 2, 2022February 6, 2022 by Tom

“I’d like to copy a multiple choice SP field to another item, what’s the best way to select only the values from the array with Power Automate?”

“I need to extract only the user email addresses, I don’t need all the other user information.”


Working with Power Automate often involves working with arrays. Sometimes it’s a simple array, but more often it’s an array of objects. And with arrays of objects there’s a difference between what you get and what you can use. For example the SharePoint multiple choice column. You’ll get 3 properties for each of the choices, but you’ll need only the “Value”.

The same applies to multiple people picker. You get all the user information, but in most cases you need only the email address.

How do you then extract only the desired values, ideally in the required format?

Use the ‘Select’ action

The action you’re looking for is ‘Select’. You’ll input an entire array of objects and select what values it should return. The action has even an option to return a simple array with the values, or another array of objects.

Select only values

You can switch the action to return a simple array by pressing the small button – it’ll keep only 2 fields visible. Enter the whole array in the ‘From’ field, and select which value you want to return in the ‘Map’ field.

Power Automate select values from array

This is often used in combination with the join(…) expression to turn the values into a string. For example, if you want to send a single email to multiple users at once.

Select values and turn them into array of object

The other option is to return an array of objects. If you keep it in the original mode, with 3 fields, you can input the array, select what values it should return, and define the property key for the value.

Power Automate select values from array

This approach is used when you want to copy the values to another place and you need them in a specific format. For example, to update multiple people picker column or a multiple choice column.

Summary

‘Select’ is one of the most powerful actions in Power Automate, it’s the easiest way to get values from an array. Instead of looping through all the objects and appending the values in a variable, you can have a single action. All you need is to find the right format of the array, and ‘Select’ it accordingly.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

10 thoughts on “How to select specific values from an array in Power Automate”

  1. Beth Beck says:
    March 22, 2022 at 10:22 pm

    Hi Tom,
    I have been trying this with a multi-select choice field and the output of the Select action is just like yours, except for with my column “Building” and the building values. I then need to send an email with the building values listed in the body. I can’t figure out how to get just the values. I’ve created a Join action after the Select action, but the email body looks like this:
    {“Value”:”Building 1″},{“Value”:”Building 4″},{“Value”:”Building 7″}

    How do I remove all the “value” text and characters and just get Building 1; Building 4; Building 7

    Thanks,
    Beth

    Reply
    1. Tom says:
      March 27, 2022 at 7:08 pm

      Hello Beth,
      you should switch the ‘Select’ action to the text input only mode, without the Key value as shown on the screenshot.

      Reply
  2. Luke says:
    May 9, 2022 at 11:49 pm

    Thank you for this post! It has helped me immensely!

    Reply
  3. Fran Lyons says:
    August 12, 2022 at 7:13 pm

    Hi Tom, This helped me a lot, but I need to extract one item from an array (department column) that matches the department field in a single item on another list.

    Source list: Department (single line of text, unique values only)
    Contact (value changes)

    Example: Department = Finance
    Contact = John Smith

    Destination: Department, Assignee, Manager, Contact
    Example: Department = Finance (manually chosen from lookup)
    Contact =

    Objective: Src Department value = Dest Department value then update Dest with current Contact and item ID

    The reason I have to do this through automate and not lookups is that this is part of a complicated time tracking process and this information will be sent to multiple lists that fulfill different objectives.

    Using your steps to Select from the array, I was able to get a list of departments. However, I need to compare Source to Destination in order to update the Destination list with the Department’s current contact.

    Let me know if this is an overreach! I’ve been struggling with this issue for about 3 months and I haven’t found a solution.

    Thank you!

    Reply
    1. Tom says:
      August 21, 2022 at 6:59 pm

      Hello Fran,
      from the description I’d think that you need a lookup to find the value in the other list as described here: https://tomriha.com/how-to-lookup-data-in-another-sharepoint-list-in-power-automate/. ‘Get items’ with a Filter Query to find the corresponding department and then use the returned item to update the Contact information.

      Reply
  4. Ian says:
    November 24, 2022 at 3:44 pm

    Hi Tom

    This seems to be exactly what i need but i’m getting stuck with automate creating extra for each loops.

    I am taking one SharePoint list and copying entries into another. Because any field that includes multiple values e.g. tags and people come out as an array of objects with lots of parts but can only be entered as an array of single values e.g. email addresses for people i need to strip them down. So within a for each stepping through each item in the list I need to pre-format those date types.

    However, I’m getting unstuck with the select action. I think i’m selecting the right dynamic content for the array (for the specific list item) for the ‘from’ input but i don’t seem to be able to create the map. Whenever i select anything that refers to the part of the object i need (e.g. the email address) automate then wraps the select action into an extra for each loop and (it’s not giving me just the options for items within the array selected in the from box).

    Any idea where im going wrong?

    Reply
    1. Tom says:
      December 5, 2022 at 8:00 pm

      Hello Ian,
      I’d check if you’re using outputs from the same action in the ‘From’ field and then in the ‘Map’ fields while adding the ‘From’ first and the ‘Map’ later. I can imagine it’d add loop if the dynamic contents came from different actions.

      Reply
  5. Nico says:
    March 3, 2023 at 4:20 pm

    Hello Tom,

    this is almost exactly what I’m looking for, thank you!

    We run a daily flow where we select multiple items that contain the value “Receipt” but can also contain other values.
    After sending a mail containing item information, we want to remove only the value “Receipt” from these items but want to keep the other values.

    Do you know a way how we can do this?

    Reply
    1. Tom says:
      March 19, 2023 at 3:26 pm

      Hello Nico,
      you can add another select where you’ll remap all the other values to their properties, but skip the “Receipt”.

      Reply
  6. Pingback: How to find Excel rows missing in SharePoint list (Power Automate)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

  • How to find Excel rows missing in SharePoint list (Power Automate)March 29, 2023
  • Check whether user exists in AAD with Power AutomateMarch 26, 2023
  • How to highlight whole SharePoint row based on calculated dateMarch 22, 2023
  • Why is your Power Automate flow running so slow?March 19, 2023
  • How to add multiple links to the Power Automate approval taskMarch 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes