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 / Create an array from M...
Power Automate
Suggested Answer

Create an array from Microsoft form data

(0) ShareShare
ReportReport
Posted on by
Hey all - trying to convert data from a microsoft form response into an array that can then be used to loop through for an excel file.
The microsoft form requires the user to enter any amount of ten digit numbers, separated by new lines. This is b/c they'll be copying from an excel file column.

So, the response to the form will always look something like this:

3200632070
3200632071
3200632072
3200632073

My flow is currently using: get response details > initialize variable as string > using compose to process the variable. Supposedly, the compose function replaces line breaks, semicolons, and spaces with commas, then splits the string into an array. However, the output looks like this:
3200632070\n3200632071\n3200632072\n3200632073

As you can see, none of the line breaks (represented by \n) were replaced by commas, so it's still showing up as one large string. What this automation is trying to do is check for matches between the microsoft form and an excel file. This file has all of these values in a column, but my flow can't check for matches b/c it's not looking for 3200632070, then 3200632071, etc., it's looking for 3200632070\n3200632071\n3200632072\n3200632073.

Does anyone know how or what I can add to ensure that the response to the form comes out as an array that a loop can use to check a file for each individual ten digit value?
 
If it's needed, the code for the compose function I'm referencing looks like this - 
{
  "type": "Compose",
  "inputs": "@\r\nsplit(\r\n    replace(\r\n        replace(\r\n            replace(\r\n                replace(\r\n                    replace(variables('var_rawIds'), '\\r\\n', ','),\r\n                '\\n', ','),\r\n            '\\r', ','),\r\n        ';', ','),\r\n    ' ', ''),\r\n',')\r\n",
  "runAfter": {
    "Initialize_variable": [
      "Succeeded"
    ]
  }
}
I have the same question (0)
  • Suggested answer
    Ellis Karim Profile Picture
    12,163 Super User 2026 Season 1 on at
     
    If the form user will be copying cells from an Excel file into a Text column inside a Microsoft Form, try the following:
     
    (1) use trim function - this removes leading and trailing whitespaces from a string:
     
    (2) Split the text at the "new line character", and you can use the following code as the new line character: decodeUriComponent('%0A')
     
    split(trim(outputs('Get_response_details')?['body/r3166d36834e34688b140292656e1069b']),decodeUriComponent('%0A')) 
     
     
     
    Ellis Karim
    Ellis Karim
    elliskarim.com  |  LinkedIn  |  Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard