cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
isavedalex
Frequent Visitor

Send email update with changes to Sharepoint list in the last 24 hours.

Hello everyone,

 

I have a sharepoint list with 3 columns for now. 

1) Sales District (single line of text)

2) Sales Rep 1 (Person or group object)

3) Temporary Cover (Person or group object)

Mapping Columns.png

I'm trying to use Power Automate to send an email notifying of any changes to this list over the last 24 hour period. I've managed to set this up in Flow so that it correctly pulls items from the sharepoint list modified in the last 24 hours, however it pulls everything from the Person/Group object, I'm trying to edit this down to just the display name. 

 

Current flow:

Mapping Flow.png

Current Output

Mapping - HTML Table export.png

 

Any help or advice would be greatly apprecaited!

 

One last note: the Sales Rep 1 column may have multiple persons assigned in some cases, so ideally I would be able to pull each of the display names at the same time.

 

Many Thanks,


Alex

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @isavedalex ,

as the multiple people picker column gives you an array of objects with all the information about the users, you'll need a complex expression to get just a specific value for each user from there:

e.g. to get comma delimited display names from 'Person_MultiplePicker' column:
join(xpath(xml(json(concat('{"body":{"value":', item()?['Person_MultiplePicker'], '}}'))), '/body/value/DisplayName/text()'), ', ')

I posted an article on the formatting of SharePoint items in an HTML table just a few days ago.

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

7 REPLIES 7
tom_riha
Super User
Super User

Hello @isavedalex ,

as the multiple people picker column gives you an array of objects with all the information about the users, you'll need a complex expression to get just a specific value for each user from there:

e.g. to get comma delimited display names from 'Person_MultiplePicker' column:
join(xpath(xml(json(concat('{"body":{"value":', item()?['Person_MultiplePicker'], '}}'))), '/body/value/DisplayName/text()'), ', ')

I posted an article on the formatting of SharePoint items in an HTML table just a few days ago.

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
v-duann-msft
Community Support
Community Support

Hi @isavedalex 

 

Thank you for your post.

 

I agree with @tom_riha to get multiple value, we need to use expression. 

 

In addition to your error while pull out people display name from output. We'd better use 'people/displayname' instead of 'people' only. 

v-duann-msft_0-1617158722785.png

v-duann-msft_1-1617158847713.png

 

Hope it helps

 

Best regards,

Anna

Hey @tom_riha ,

 

Thank you so much for your response! this looks like exactly the right solution for me, but I'm having a little bit of trouble implementing it.

 

To simply things, I renamed the sharepoint column Sales Rep 1 to 'ISSR' and tried the expression you provided but I replaced ['Person_MultiplePicker'] with ['ISSR']

 

join(xpath(xml(json(concat('{"body":{"value":', item()?['ISSR'], '}}'))), '/body/value/DisplayName/text()'), ', ')

isavedalex_0-1617182192045.png

 

When testing the flow like this, I get the following error.

The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{
  "District": "@item()?['Title']",
  "ISSR": "@join(xpath(xml(json(concat('{\"body\":{\"value\":', item()?['ISSR'], '}}'))), '/body/value/DisplayName/text()'), ', ')\r\n",
  "Temporary Cover": ""
}' failed: 'The template language function 'json' parameter is not valid. The provided value '{"body":{"value":}}' cannot be parsed: 'Unexpected character encountered while parsing value: }. Path 'body.value', line 1, position 17.'. Please see https://aka.ms/logicexpressions#json for usage details.'.

 

Hello @isavedalex ,

you must use the column internal name in the expression, expression don't care about the display name. You can take the internal column name from the url if you go to the 'Edit column' page.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Thank you so much for your help @tom_riha , you've saved me countless hours here!

 

Can I donate a Coffee/Beer or something else to you to say thank you? 

Hello @isavedalex ,

you can buy me a coffee on my blog if you'd like, but a 'thank you' is more than enough. 🙂



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
snehabirajdar17
New Member

Will you please put query for this

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (4,177)