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)
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:
Current Output
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
Solved! Go to Solution.
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.
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.
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.
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()'), ', ')
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.
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. 🙂
Will you please put query for this
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
62 | |
51 | |
29 | |
28 | |
24 |