Problem
The customer asked how to do the steps described in the following article in Power Automate? The article uses SharePoint Designer and SharePoint Workflow.
SHOW THE MOST RECENT COMMENT FROM SHAREPOINT TEXT FIELDS INSTEAD OF “VIEW ITEMS”
The scenario is the above list contains two columns ‘Comments’ and ‘MostRecentComments’. The ‘Comments’ column has multiple text but shows it as ‘View Entries’. The SharePoint view shows that because the list is created as ‘version’ enabled list. Every text entered in the ‘Comments’ column it is stored as a version including null.
The common technique is to last comments entered in the list is to add another column called ‘MostRecentComments’. Using the flow as an item added or modified copy the *last* comment entered to the MostRecentComments field.
Step By Step Solution
Step #1 Create a new Power Automate Flow with the Trigger as ‘When an item is created or modified’. Add your Site Address and List Name to the Trigger.
Step #2 Next you will add a trigger condition by clicking on ‘…’ and ‘Settings’. In the Trigger Conditions you will add the following line. Please make a note don’t forget ‘@’ before the expression.
@not(equals(triggerOutputs()?['body/Comments'],null))
Step # 3 Now update the ‘MostRecentComents’ with the last comment added by the user.
Results
As you can see the results the flow runs when the new item is created or modified, the flow updates the ‘MostRecentComments’ field with the last comment. The flow will also skip if user do not add anything in the comments as the trigger condition checks for the null value in the comments.
Please write your comments if this helps you.
Pingback: Part Two – Using Power Automate show the most recent comment from SharePoint text fields instead of “View Items” | Pankaj Surti's Blog
Hello Pankaj, I tried to set this up. I get a warning from flow checker saying that actions in this flow may result in an infinite trigger loop :O. I should add appropriate conditional checks to prevent the flow from triggering itself. Any idea what I can have done wrong? Hopeful to get it to work 🙂
@jensih I had this same issue, and am curious if you found a solution.
For updating the same item in the list this is a standard warning. You can fix this, follow https://pankajsurti.com/2021/06/25/how-to-fix-an-infinite-trigger-loop-in-power-automate/