Hi @nikitamobile85
For the error, it looks like there is nothing inside your 'createArray()' function at the start? - for this expression, you need to add the inputs/dynamic content available from the trigger in between the function brackets i.e. createArray(email1, email2, email3 etc...)

Didn't mention this previously, but if you only want teh DisplayName, show advanced options adn insert DisplayName (as the only field you want back) - this refines your flow. See below:

Now to get teh names how you want, you need to 1) initialise an Array variable, 2)append to that array variable inside the For Each Loop 3) reference the relevant Array variable item in your final step to get the respective displaynames
1) Initialise an Array variable above your Apply to Each step

2) Add an Append to variable step inside the Apply to each, pick the variable you have just initialised and add the DisplayName dynamic content

3) in your final step where you want to add the display names into the variable, for each name that you need, just go to the relevant item in your final variable step, open up expressions, select the new array variable with the names from above from the available dynamic content and simply add '[0]' at the end to grab the first name, '[1]' at the end for the second name etc etc - See below an example of where I grab the first name in the array variable below
