Skip to main content

INPUT: 12,5,3,8,2
Store it in a string variable then do sorting (use any logic) and at last assign the output in a string variable
OUTPUT: 2,3,5,8,12

How to create this workflow


 

Hi ​@Prakash 355 ,

 

You can try the below logic to start with:

  1. Store Input String in a Variable:

    • Create a string variable, e.g., 

      $inputString$

    • Assign the unsorted numbers as a comma-separated string, e.g., 

      "12,3,5,2,8"

  2. Split the String into a List/Array:

    • Use the String: Split action with delimiter 

      , on $inputString$

    • Store result in a list variable, e.g., 

      $numberList$

  3. Convert List Items to Numbers (Optional):

    • If needed, convert each list item from string to integer for numeric sorting.
  4. Sort the List:

    • Use a loop or built-in sorting logic if available.
    • If no built-in sort, implement a simple sorting algorithm (e.g., bubble sort) on 

      $numberList$

  5. Join the Sorted List Back to String:

    • Use String: Join action with delimiter 

      , on the sorted list $numberList$

    • Store result in a string variable, e.g., 

      $outputString$

  6. Output the Result:

    • Use message box, log, or assign 

      $outputString$ for further use.

 

Note: This is just one of many possibilities of the logic.


INPUT: 12,5,3,8,2
Store it in a string variable then do sorting (use any logic) and at last assign the output in a string variable
OUTPUT: 2,3,5,8,12

How to create this workflow


 

you can check below links for solution.
1. Sort action
https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/excel-advanced-package-sort-table-action.html
2. Community workaround for sorting list
 https://community.automationanywhere.com/developers-forum-36/how-to-sort-a-list-in-a360-86934
 


Reply