Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.

Create an Excel Script

First, we must create a script in SharePoint by following the steps below.

Open SharePoint, select documents from the pane on the left side and click on the new button and select Excel workbook from the options.

This will open a new Excel workbook, from the options on the workbook select Automate

A code editor will open on the right corner where we can add the script.

Add the below code to Sort the Array

After the code is completed, the file is auto saved

Use Script in Flow

Now, we can use the above script from the flow to sort the Array. Select the operation run script from Flow, where you want the sorting to be done.

Create a connection reference to the SharePoint site where the script is created from the flow by clicking on the options from the step and selecting ‘new connection reference.

Once the connection is created, Select the location as SharePoint site where the script is created, and all the other fields as required.

This way we can sort an array from Flow using Script.