“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.
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.
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.
‘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.