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 / Extract specific attri...
Power Automate
Unanswered

Extract specific attributes of an array to form a new array

(0) ShareShare
ReportReport
Posted on by 82

Hi,

 

I have the following a big Array that looks like this. 

{
    "body": [
        {
            "Date""24/Apr/2023",
            "Subject""Maths",
            "Start Time""08:30 AM",  
            "End Time""09:30 AM",
            "Lunch Duration"0
        },
        {
            "Date""24/Apr/2023",
            "Subject""Lunch",
            "Start Time""12:00 PM",
            "End Time""12:30 PM",
            "Lunch Duration"30
        },
        {
            "Date""24/Apr/2023",
            "Subject""English",
            "Start Time""02:30 PM",
            "End Time""03:30 PM",
            "Lunch Duration"0
        }
{
            "Date""25/Apr/2023",
            "Subject""Maths",
            "Start Time""07:30 AM",
            "End Time""09:30 AM",
            "Lunch Duration"0
        },
        {
            "Date""25/Apr/2023",
            "Subject""Lunch",
            "Start Time""12:00 PM",
            "End Time""12:50 PM",
            "Lunch Duration"50
        },
        {
            "Date""25/Apr/2023",
            "Subject""English",
            "Start Time""01:30 PM",
            "End Time""03:30 PM",
            "Lunch Duration"0
        }

    ]
}

I want to create a new Array that combines the first 3 attributes such that my new Array looks like this.
 
{
"body": [
        {   "Date": "24/Apr/2023",
           "Start Time": "08:30 AM",
           "Lunch Duration": 30,
          "End Time": "03:30 PM"
       }
      {   "Date": "25/Apr/2023",
           "Start Time": "07:30 AM",
           "Lunch Duration": 50,
          "End Time": "03:30 PM"
       }
]
}
 
I'm only interested in the "Date", "Start Time", "Lunch Duration" and "End Time" in that order. My original Array has that in this order.
 
Thank you 
Categories:
I have the same question (0)
  • Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi @User_Naami 

     

    As per my understanding you are looking for reordering the 'body' array and save it in another array variable. To achieve this, you may use "Select" action for reordering the elements and then use the output of "Select" action to create a new array variable.

     

    Sample flow with actions are as follows:

    ManishSolanki_0-1683123772376.png

    ManishSolanki_1-1683123899396.png

     

    If it solves your problem then, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

  • User_Naami Profile Picture
    82 on at

    HI @ManishSolanki The logic does not work for me. 

    This is what my flow looks like that produces my array.

    User_Naami_0-1683142982576.png

     

    The result of my "Select" produces the following array:

    {
        "body": [
            {
                "Date""24/Apr/2023",
                "Subject""Maths",
                "Start Time""08:30 AM",  
                "End Time""09:30 AM",
                "Lunch Duration"0
            },
            {
                "Date""24/Apr/2023",
                "Subject""Lunch",
                "Start Time""12:00 PM",
                "End Time""12:30 PM",
                "Lunch Duration"30
            },
            {
                "Date""24/Apr/2023",
                "Subject""English",
                "Start Time""02:30 PM",
                "End Time""03:30 PM",
                "Lunch Duration"0
            }
    {
                "Date""25/Apr/2023",
                "Subject""Maths",
                "Start Time""07:30 AM",
                "End Time""09:30 AM",
                "Lunch Duration"0
            },
            {
                "Date""25/Apr/2023",
                "Subject""Lunch",
                "Start Time""12:00 PM",
                "End Time""12:50 PM",
                "Lunch Duration"50
            },
            {
                "Date""25/Apr/2023",
                "Subject""English",
                "Start Time""01:30 PM",
                "End Time""03:30 PM",
                "Lunch Duration"0
            }

        ]
    }

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard