web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert an array of st...
Power Automate
Unanswered

Convert an array of strings to an array of objects

(1) ShareShare
ReportReport
Posted on by 86

Hey All,

 

I'm currently working on a flow that reads a csv received daily, compares the data in some table in azure and then adds the data to the table if it is not already present.

There doesn't seem to be a connector to read csv nicely so I just fetched the file content and then converted it to string from base64.

I then split the data into rows, with the first row being the headers of the data (each column is comma separated) and every row after that is the actual data (also separated by commas).

 

Wondering if there is an easy way to convert this data to an array of objects as that is the output of the azure table when I query it and it would make it easier to compare with the csv data.

 

This is a sample of how the data is formatted

 

[

"first name, last name, address", email",

"bob, white, 4367 st, bob@gmail.com",

"frank, blue, 9849 ave, frank@gmmail.com",

...

]

 

I've removed the header from the rest of the data and then split by comma so I have an array representing headers like

["first name", "last name", "address", "email"]

and can do the same with the rest, but unsure then how to connect into a an array of objects. I tried a select operation but it is throwing an error. 

 

Any help is appreciated.

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Convert an array of strings to an array of objects

    Hi @fabiofa ,

     

    I've made a test for your reference:
    1\My flow

    vbofengmsft_1-1716427619912.png

    vbofengmsft_2-1716427638720.png

    Apply to each

    skip(variables('OrigionalArray'),1)

    Compose

    variables('OrigionalArray')[0]

    Append to array

    {
    "@{split(outputs('Compose'),',')[0]}":@{split(items('Apply_to_each'),',')[0]},
    "@{split(outputs('Compose'),',')[1]}":@{split(items('Apply_to_each'),',')[1]},
    "@{split(outputs('Compose'),',')[2]}":@{split(items('Apply_to_each'),',')[2]},
    "@{split(outputs('Compose'),',')[3]}":@{split(items('Apply_to_each'),',')[3]}
    }

    2\Result

    vbofengmsft_0-1716427601072.png

     

    Best Regards,

    Bof

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard