I am trying to create a flow that pulls all open items in a list and emails a weekly table. I have everything working so far, but I am unable to pull the DisplayName from the original requester and their manager. I do not know how to pull the DisplayName from an array. Below is the error I am seeing
'DisplayName' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.
Thank you for helping.
Solved! Go to Solution.
Hi @Anonymous ,
It seems that these two columns allow multiple selections.
One method to solve this problem is you could set these two columns not allow multiple selections.
Like:
Then you could refer to item()['ColumnName']['DisplayName'] to get the value in Select action.
If you don’t want to set these two columns allow multiple selections, you could refer to the following method. I will take one of the fields as an example, and you can use the same method to handle the other field.
You need to add one more string variable, and then use the same method to get the Manager Name and append it to the array variable.
Image reference:
Please take a try.
Best Regards,
@Anonymous
If I understand your issue, you want to take selected columns from a SharePoint Get items action, put them in an HTML table and send via email. If that is the case, my example below should help you. I am using the Created by column as an example, but it is just a person or group column - works the same for any person or group column. If you need to filter the items returned, you should be using an OData filter in the Get items action - very easy to do.
The OData filter should look something like this:
Request_x00x20_Status eq 'value 1' or Request_x0020_Status eq 'value 2'
Hi Scott,
Thank you for the reply.
Yes, you are correct. I am trying to get items from the list, put them in an HTML table and send an email. However, I have two user columns (Requester & Manager) that I want to pull the names and put them in a table. The created by would work for the requester, but not manager. When I follow your example, I get a jumbled mess for an email (See Below).
I am not familiar with the ODATA function, but after some quick researching, I'm not certain if it is what I need. Is there not a way I can just pull the DisplayName out of the data and have that posted in the column?
Hi @Anonymous ,
It seems that these two columns allow multiple selections.
One method to solve this problem is you could set these two columns not allow multiple selections.
Like:
Then you could refer to item()['ColumnName']['DisplayName'] to get the value in Select action.
If you don’t want to set these two columns allow multiple selections, you could refer to the following method. I will take one of the fields as an example, and you can use the same method to handle the other field.
You need to add one more string variable, and then use the same method to get the Manager Name and append it to the array variable.
Image reference:
Please take a try.
Best Regards,
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |