cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
drewdev
Helper I
Helper I

Unable to extract appended Comments from Multi-Text field using a Flow

Hoping someone can assist – I’m trying to setup an instant flow that runs off a button in PowerApps that gets appended comments from a multi-line text field in SharePoint called “Comment”

Display Appended Comments Version History From SharePoint List On PowerApps (c-sharpcorner.com)

 

I found this article and I can re-create the exact flow they show, but I get the following error at the Apply to Each part:

drewdev_0-1664817126845.png

I have confirmed ID 49 has multiple comments so I can’t figure out why it keeps coming back as Null.

 

Parse JSON: 

{
    "type""object",
    "properties": {
        "value": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "Comment": {
                        "type""string"
                    }
                },
                "required": [
                    "Comment"
                ]
            }
        }
    }
}


Any help figuring this out would be much appreciated as I need to implement this type of solution in many different forms we have in the environment.

I have screenshots of the Flow and the JSON Outputs, but I'm not exactly sure how to attach them so they can be viewed.

 

Thanks so much!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @drewdev ,

 

To be honest, I didn't follow the link you provided exactly, I made a simplified version for your reference.

1. Here is my List.

vyujincuimsft_0-1664950306847.png

2. Here is my Flow.

body('Send_an_HTTP_request_to_SharePoint')?['value']
concat('<div><font color=green>',items('Apply_to_each')['Author']['LookupValue'],' (',convertFromUtc(items('Apply_to_each')['Modified'], 'China Standard Time', 'MM/dd/yyyy hh:mm tt'),'):<div>',items('Apply_to_each')['Comment'],'</div></div>')

vyujincuimsft_1-1664950342031.png

vyujincuimsft_5-1664952399237.png

vyujincuimsft_3-1664950721232.png

3. Here is my App.

Set(AppendCommentsMore,GetAllversions.Run("1").result)

vyujincuimsft_6-1664952502737.png

Here is a link for your reference.

Default Time Zones | Microsoft Learn

 

 

Best Regards,

Charlie Choi

View solution in original post

3 REPLIES 3
v-yujincui-msft
Community Support
Community Support

Hi @drewdev ,

 

To be honest, I didn't follow the link you provided exactly, I made a simplified version for your reference.

1. Here is my List.

vyujincuimsft_0-1664950306847.png

2. Here is my Flow.

body('Send_an_HTTP_request_to_SharePoint')?['value']
concat('<div><font color=green>',items('Apply_to_each')['Author']['LookupValue'],' (',convertFromUtc(items('Apply_to_each')['Modified'], 'China Standard Time', 'MM/dd/yyyy hh:mm tt'),'):<div>',items('Apply_to_each')['Comment'],'</div></div>')

vyujincuimsft_1-1664950342031.png

vyujincuimsft_5-1664952399237.png

vyujincuimsft_3-1664950721232.png

3. Here is my App.

Set(AppendCommentsMore,GetAllversions.Run("1").result)

vyujincuimsft_6-1664952502737.png

Here is a link for your reference.

Default Time Zones | Microsoft Learn

 

 

Best Regards,

Charlie Choi

Thank you Charlie! This works as intended - I just switched the "1" to the Gallery.Selected item and it pulled in perfectly within the app. 


Is there an easy way to format the HTML text to separate out the sections (Comment time/ name etc) into different colors? like you have shown in your final screenshot

 

And any way to add a line break in between each comment? Need to try and clean up the formatting so it provides a better user experience. Thanks for your help!

v-yujincui-msft
Community Support
Community Support

Hi @drewdev ,

 

Maybe you could try the following expressions.

concat('<div><font color=green>',items('Apply_to_each')['Author']['LookupValue'],' <font color=blue>(',convertFromUtc(items('Apply_to_each')['Modified'], 'China Standard Time', 'MM/dd/yyyy hh:mm tt'),'):<div>',items('Apply_to_each')['Comment'],'</div></div><br />')

vyujincuimsft_0-1665020919348.png

 

 

Best Regards,

Charlie Choi

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,617)