cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Sort JSON array by key

Hi there,

 

I am using the action "Parse JSON" in my Flow and would like to sort the results by a specific key.

 

So, in the following example I want to sort elements by "SubscriptionName". Can anyone help me to find the correct answer and tell me where to insert by sort function into the following code?

 

Thx in advance

Dorothee

 

{
    "type""array",
    "items": {
        "type""object",
        "properties": {
            "Charge DateDif": {
                "type""integer"
            },
            "ChargeEndDate": {
                "type""string"
            },
            "ChargeStartDate": {
                "type""string"
            },
            "CustomerID": {
                "type""string"
            },
            "Id": {
                "type""string"
            },
            "IdRechnungsnummer": {
                "type""string"
            },
            "MailSent": {
                "type""string"
            },
            "Quantity": {
                "type""integer"
            },
            "Source.Name": {
                "type""string"
            },
            "SubscriptionName": {
                "type""string"
            },
            "VK": {
                "type""number"
            },
            "Auftragsnummer": {
                "type""string"
            },
            "CustomerName": {
                "type""string"
            }
        },
        "required": [
            "Auftragsnummer",
            "Charge DateDif",
            "ChargeEndDate",
            "ChargeStartDate",
            "CustomerID",
            "CustomerName",
            "Id",
            "IdRechnungsnummer",
            "MailSent",
            "Quantity",
            "Source.Name",
            "SubscriptionName",
            "VK"
        ]
    }
}
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Dorothee123,

 

It's unfortunate insert in order function into the schema is not supported on Power Automate yet.

As a workaround, there is a blog that sorts an array by building an expression:

https://sharepains.com/2019/07/13/sort-an-array-or-collection-in-microsoft-flow/

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @Dorothee123,

 

It's unfortunate insert in order function into the schema is not supported on Power Automate yet.

As a workaround, there is a blog that sorts an array by building an expression:

https://sharepains.com/2019/07/13/sort-an-array-or-collection-in-microsoft-flow/

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks @v-litu-msft for your quick reply

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,847)