web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Comments and mentions?
Power Apps
Unanswered

Comments and mentions?

(3) ShareShare
ReportReport
Posted on by 155
Hi, 
 
This one is beyond me as i have borrowed some code and processes but hoping someone might be able to help.  I have a flow for pulling comments from a list,
 
_api/web/lists/getbytitle('Stores Order List')/items(<item ID>)/Comments
 
 
These are then displayed within a gallery with
 
Table(ParseJSON(varstores))
 
but all the mentions are being shown as @mention{0}.   Is there any easyway to resolve these into actual names, and to use mention tags when posting comments back within the app?  I have a post option for this  
 
Set(varstores,StoresComments.Run("Post",Gallery1.Selected.ID,{text_1:TextInputCanvas1.Value}).response);Reset(TextInputCanvas1);
 
 
Categories:
I have the same question (1)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Do you see the name in the raw JSON?
    What is the structure of the JSON?
  • TBODEN Profile Picture
    155 on at
    Hi,
     
    This is what is seen in the raw JSON, i mentioned myself in a test comment
     
    \",\"mentions\":{\"__metadata\":{\"type\":\"Collection(Microsoft.SharePoint.Comments.Client.Identity)\"},\"results\":[{\"email\":\"Thomas.Boden@ramsayhealth.co.uk\",\"id\":12,\"loginName\":\"i:0#.f|membership|thomas.boden@ramsayhealth.co.uk\",\"name\":\"Boden, Thomas\"}]},\"modifiedDate\":null,\"parentId\":\"0\",\"replyCount\":0,\"text\":\"@mention&#123;0&#125;  test comment\"}]"




     
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Is Thomas Boden the name of the person who added the comment
     
    {
      "mentions": {
        "__metadata": {
          "type": "Collection(Microsoft.SharePoint.Comments.Client.Identity)"
        },
        "results": [
          {
            "email": "Thomas.Boden@ramsayhealth.co.uk",
            "id": 12,
            "loginName": "i:0#.f|membership|thomas.boden@ramsayhealth.co.uk",
            "name": "Boden, Thomas"
          }
        ]
      },
      "modifiedDate": null,
      "parentId": "0",
      "replyCount": 0,
      "text": "@mention{0} test comment"
    }
  • TBODEN Profile Picture
    155 on at
    Hi yes,  I added the comment but I also mentioned myself within it though as a test comment
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    When the json is in a more readable format
     
    Set(varJsonData, JSON(
        {
            mentions: {
                results: [
                    {
                        email: "Thomas.Boden@ramsayhealth.co.uk",
                        id: 12,
                        loginName: "i:0#.f|membership|thomas.boden@ramsayhealth.co.uk",
                        name: "Boden, Thomas"
                    }
                ]
            },
            modifiedDate: Blank(),
            parentId: "0",
            replyCount: 0,
            text: "@mention{0} test comment"
        }
    ));
     
    we see the array for results.
     
    The array starts at 0 @mention{0} refers to the first person in this array
    results: [
                    {
                        email: "Thomas.Boden@ramsayhealth.co.uk",
                        id: 12,
                        loginName: "i:0#.f|membership|thomas.boden@ramsayhealth.co.uk",
                        name: "Boden, Thomas"
                    }
                ]
     
    which is you,
     
    If you add more mentions @mention{1, @mention{2}} you will see more people in the results
     
    You have to extract them into a table and match the index values to get the names.
     
    Try adding more mentions and test it 
  • TBODEN Profile Picture
    155 on at
    Forgive my ignorance, Ive added some extra comments and mentioned a different person each time, looking at the raw data from the flow,  the mentions are all still showing as mention{0} ,  would this be as its the first mention for each person?  im using this to get the data 
     
    Set(varstores, StoresComments.Run("Get",Gallery1.Selected.ID).response)  and then 
     
    Table(ParseJSON(varstores))
     
    I dont know how to display it as you have below and certainly not how to look it up as part of the gallery displaying the comments 
     
     
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    I parsed the response and was using it in a canvas app as it is easier to read.
     
    Sorry I could not find documentation on the API but all the comments say that SharePoint is not returning the @mention{0} properly. Everybody in the particular mention for the item is referenced with a 0 index. Based on this response you cannot determine who is being referred to at which point. You only know that the people in the results list were mentioned. Does this really matter?
    If so, you can try exploring SharePoint responses using the Graph Explorer Graph Explorer | Try Microsoft Graph APIs - Microsoft Graph to determine the correct API call and if the response indicates the person referred to at that point in the comment.
     
    If there is more than one comment associated with the item
     
     
    doesn't the JSON response show an array with two text keys?
     
    @mention{0} will appear in each but it will always be referencing the people in the results array
     
     
     
    This shows how Power Automate can be used to parse and extract the JSON Persnickety about PowerApps: Pull Comments From SharePoint List Items Into a Field
     
    I don't know what you are doing here Set(varstores, StoresComments.Run("Get",Gallery1.Selected.ID).responseas I don't know what you are passing to the canvas app.
  • TBODEN Profile Picture
    155 on at
    Hi,
     
    "mentions": {
                            "__metadata": {
                                "type": "Collection(Microsoft.SharePoint.Comments.Client.Identity)"
                            },
                            "results": [
                                {
                                    "email": "Thomas.Boden@ramsayhealth.co.uk",
                                    "id": 12,
                                    "loginName": "i:0#.f|membership|thomas.boden@ramsayhealth.co.uk",
                                    "name": "Boden, Thomas"
                                }
                            ]
                        },
                        "modifiedDate": null,
                        "parentId": "0",
                        "replyCount": 0,
                        "text": "@mention&#123;0&#125; CC'd you in an email asking if this product can be added to Amazon business"
     
     
     
    That is a post by someone else mentioning me, so it is definetely referencing who the mention is as part of the output data.  Currently this displayed within the gallery using 
     
    ThisItem.Value.text
     
    would it be naieve to think that it would be as simple as using replace to alter the @mention&#123;0&#125; to the name? 
  • TBODEN Profile Picture
    155 on at
    Ok,  I have managed to get the gallery to show  the name with:
     
    Substitute(
        ThisItem.Value.text,
        "@mention&#123;0&#125;",
        First(ThisItem.Value.mentions.results).name
    )
     
    This is on the assumption that there is only one mention at this point.
     
    I want to be able to post mentions too:
     
    currently it just posts the name within the text box using 
    Set(varstores,StoresComments.Run("Post",Gallery1.Selected.ID,{text_1:PostPerson.Selected.DisplayName & ": " &
     
    TextInputCanvas1.Value}).response);Reset(TextInputCanvas1);Reset(PostPerson)
     
     
    in the powerautomate I have the body in the send HTTP request as 
    {
      "text": "@{triggerBody()?['text_1']}"}
     
    im assuming i will need to reference the correct mention data within here?
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard