I have a flow which outputs full names of users. I need to get the UPN of these users, however as shown in the figure I am unable to get them using Search for Users. It outputs a null value. I would really appreciate someone's help here.
Hi @Pathum1 ,
The issue here is that you are searching on multiple names at once.
Try the following;
Initialize an array and if possible add the names to the array, and then select the variable as the output and currentitem in the office search:
{ Please click Accept as solution ✔ if my post answered your question. }
{ This will in turn help others find solutions to similar questions. }
Best Regards
Heartholme
Thank you for this!
So my flow is designed in a way where it outputs either one, two, or three names (or none) separated by commas as a string. How can i add them into an Array as separate items?
You already have your compose_3 in an array format. So in the start of the flow initialize a variable as an vArray and then append compose_3 into an array.
Then use the append to array inside the apply to each.
Let me know how this goes 😊
Hi,
I get the following error when i try to append compose_3 into an array
.............. of type 'Array' cannot be appended to the variable 'vArray' of type 'Array'. The action type 'AppendToArrayVariable' only supports values of types 'Float, Integer, String, Boolean, Object'.
Oh right, forgot that this dosen't work when your output already is an array. Remove the brackets from the initiate variable, and use a set variable with your compose instead of append to array, that should work.
I see that you get the new line ("/n") in your compose as well, so add these steps before you take it into the set variable:
See @tom_riha 's post on this: https://tomriha.com/how-to-replace-new-line-n-in-a-power-automate-expression/
If you have any questions, please let me know 😊
In terms of your flow:
Then the last compose goes into the set variable.
Whilst thanking your for the amazing insight, I feel like I need to provide a better background of my issue in hope of getting my issue resolved.
So i've got an excel sheet which I import to my Sharepoint List. In this list there is a column named "Auditors" which can contain multiple values or no values at all. There are currently around 60 records in this list.
I need to convert these to obtain the O365 UPNs in order for my Powerapp to filter the content associated to the particular user.
Below is the result of me running APPLY TO EACH using the value list of the aforementioned Sharepoint List and composing the values of the "Auditors" column.
Below is the raw output of the above Compose.
So I try to clean it up with the replace expression and below is the result (Compose 3)
Below is the raw output of Compose 3
Now all I want to do is pass these names through SEARCH FOR USERS (V2) for the entire 60 odd records I have in my sharepoint list and then record the UPNs in another Column that can be used by powerapps.
I hope I gave some more context to my problem. The whole array business is a little unclear to me.
Thanks again for trying help!
Sorry for the late reply, I have been quite preoccupied with work lately.
What you want to achieve is to have only the names in an array.
This should help you out:
First you have your starting input. Note, I included the team leader/member/observer, but you just use the replace you have to filter these out and just have the names.
Then use the NewL and compose to remove the new lines from the output, since this will cause the "\n" to mess up your search.
Code for these
NewL variable with an enter/lineshift in the text:
Then this compose which takes your 'final' compose with only the names:
replace(outputs('Compose_3'),variables('NewL'),';')
This will replace each new line with an ";".
Then split the output of that compose with an
split(outputs('compose'),';'), in order to create an array from the compose:
Then use an apply to each, to iterate through each name, and update an sharepoint list with the information:
Let me know if you have any more issues 😊
{ Please click Accept as solution ✔ if my post answered your question. }
{ This will in turn help others find solutions to similar questions. }
Best Regards
Heartholme
User | Count |
---|---|
95 | |
46 | |
21 | |
18 | |
17 |
User | Count |
---|---|
140 | |
50 | |
42 | |
39 | |
29 |