How Change elements index in array?

Hi Team,

I Have an array
arryName={“balu”,“venki”,“pavan”,“hari”,“Yadav”}.some times values will not be same except “pavan”.

I want to “pavan” will get at first (0th index).
How can we do this? can someone help me on this.

@workhard86400
Welcome to the forum

we can manually reorder the array (take value, swap value, For each loop and bring value to first position…)
Or
order it with a custom sorting

grafik
arrNames.OrderByDescending(Function (x) Array.IndexOf(arrSorting, x)).ToArray

when pavan will not be present, the code will not fail
grafik

First convert array to list type.
Use assign activity: list_variable = array_variable.ToList()

After that change the index of the element in the list.
Refer this link to change list item index.

Then convert the list to array type.
Use assign activity: array variable = list_variable.ToArray()