Guides Microsoft Flow Power Automate Power Platform

Copy multiple people and multiple choice fields

How to create or update multi-select person, group, and choice fields in a Microsft SharePoint List using Microsoft Power Automate (Flow).

A quick guide on how to handle multi-select person, groups, and choice fields in a Flow.

1. Initial Situation

Let’s say we have two Microsoft SharePoint lists with a multi-select person and a multiple-choice column each.

In this example, we want to copy values from List A to List B.

List A has the following data:

List A has multiple users and multiple devices in each row.
The Title column is irrelevant.

List B has no data yet:

List B is empty.

Now, let’s see how we can get the data from List A and create the rows in List B.

2. Trigger the flow and get the data from List A

But first things first… for our example, we need to trigger the flow and get all values from List A using the Get items action.

I’ve decided to manually start the Flow. For you, the trigger might be a scheduled event.

3. Using the Select action, copy a multiple person or multiple choice column. 

To create or update a multiple-person, group, or multi-select choice column in a Microsoft SharePoint list, you’ll need to use the Select action.

Add an Apply to each action and loop through all rows from List A using the dynamic content value from the Get items action.

Inside the loop, add two Select actions.

In the From field of the first Select action, insert the dynamic content People.

In the Map section of the first Select action, write Claims inside the key field and the expression item()?[‘Claims’] inside the value field.

Make sure you enter the item()?[‘Claims’] string as an Expression!

In the From field of the second Select action, insert the dynamic content Devices.

In the Map section of the second Select action, write value inside the key field and the expression item()?[‘Value’] inside the value field.

Make sure you enter the item()?[‘Value’] string as an Expression!

4. Update the Microsoft SharePoint List B

All we now have to do is simply add a Create item action to create the items in List B.

In the People and Devices column, click on the icon on the right side of the field to change the input to an entire array.

Then select the dynamic content Output from the Select actions. Make sure you select the right dynamic content for the right field… (People / Devices)

Dynamic content Output People goes into the People column.
Dynamic content Output Devices goes into the Devices column.


Let’s test the Flow and check if it worked.

The whole Flow in edit mode.
The Flow ran without any errors.

As you can see, all the data from List A is now inside List B.

Guides Microsoft Flow Power Automate Power Platform

Remove Characters

How to remove a certain number of characters from the end of a string value in Microsoft Power Automate (Flow).

A quick guide on how to quickly cut characters from a string value in a Flow.

1. Initial Situation

Let’s say we have a dynamic content string value where we want to remove the last three characters.
An example for this would be a date where we don’t want the days, only year and months.

Example “Compose” action

So basically turn this:


in to:


To do this, we need to remove -06 from the first string.

2. Expression

The Expression we use, to get rid of a certain amount of characters at the end of a string is the following:


Let’s replace STRING in the above Expression with our dynamic content from the flow.

In our case, that’s the Compose – Date action.


If you want to remove, let’s say, 5 characters instead of only 3, just change the number 3 at the end of the Expression to 5. Like this:


The flow now looks like this:

Don’t forget to add the formula as an Expression!


When we now run the flow, we get the following result:

Check – we successfully cut the -06 from the string value

As you can see, the sign and the days have been removed from the string value.

Guides Microsoft Flow Power Automate Power Platform

Sanitize Strings

How to remove unwanted characters from a string in Microsoft Power Automate.

A quick guide on how to easily sanitize your text values in a Flow.

1. Initial Situation

Let’s say we have a string value. It does not matter from what trigger or action it comes from. In my case, I just have a Compose action with the following Input (value).

       amzAMZ160,.-;:_@)s9=)"*       =ç%&/"()=ç&Z"=                     

There are a lot of special characters and empty spaces in there that I do not want, but the end user has entered them anyways… 🙄 😀

2. Trim() – Remove all unnecessary empty spaces

The first thing I always do is use the trim() function on the string. This function removes all extra spaces from a string of text.

I do this right inside the Initialize variable action. Name it InitialString and as an Expression in the Value field, you enter the following code.


After the first two actions, our output now looks like this:

amzAMZ160,.-;:_@)s9=)"*       =ç%&/"()=ç&Z"=

Notice that the empty spaces at the front and at the back are not there anymore!

3. Map() – Create an array

Let’s now map our string and put every character as a single value in an array. This way, we can then check every character for its legitimacy later.

To create an array from a string value, we use the Select action with the following two expressions as From and Map values:


range(0, length(variables('InitialString')))


Make sure you click on Switch Map to text mode before you enter the following expression.

substring(variables('InitialString'), item(), 1)

Your Select action should now look like this:


Let’s check our output so far. After running the flow, we now have an array with every character of the initial string.

4. Allowed Characters

Let’s now define the characters that we will allow to remain in the string. For me, it’s all alphanumeric characters.

That means a-z, A-Z, and 0-9.

Create a new array (Initialize variable), call it AllowedCharacters, and put the following code as its Value as an Expression.


If you want to allow some special characters or more letters, you can simply edit the createArray() function to your liking. For example, to add ö,ä,ü,Ö,Ä and Ü the function would look like this:


After that step, I also add another new variable, this time a string variable, that will hold our sanitized value at the end. This will also be the variable that you will use after the sanitization for the rest of your flow.

Let’s call it ValueAfterSanitization. Value stays empty for now.

5. Remove any unwanted characters

This is where the magic happens…

We will loop through every character from the InitialValue array (created by the Select action) and check if it is in the AllowedCharacter array or not. If it is, we append it to the string variable ValueAfterSanitization.

To start the loop, add an Apply to each action. For its Value, choose the dynamic content Output from the Select action.

Add a Condition action inside the Apply to each.

  • The first value is the AllowedCharacters array
  • operator is contains
  • The second value is the expression: item()

This means we check each character (item()) if it is somewhere in the AllowedCharacters array.

In the If yes section of the Condition, we now add the character to the ValueAfterSanitization variable.

The If no section can stay empty, those item()s are the characters that we don’t want in our string.


Let’s do one last check. We add a Compose action with the Input ValueAfterSanitization.

At the top, we can see our trimmed string had 44 characters. We looped through each one of them and only added the characters we wanted to the ValueAfterSanitization variable.

In the last Compose action at the bottom, we can now see our sanitized string. Completely without special characters and empty spaces.

We went from this:

               amzAMZ160,.-;:_@)s9=)"*       =ç%&/"()=ç&Z"=                     

to this:


Conclusion / Summary

Instead of checking for characters that we don’t want to allow, we simply defined an array with the characters that we do allow.

This way, we don’t have to worry about different languages with weird (special) characters or emojis.

The whole Flow looks like this