cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kristinamariz
Helper II
Helper II

How to remove null on append comments

Hi Team,

 

Good day! I have followed the procedure below to show appended comments in PowerApps:
https://www.c-sharpcorner.com/article/display-appended-comments-version-history-from-sharepoint-list...

 

I just added null in the parse JSON

 

 

 

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

 

 

 

Here's the result of the display in PowerApps:

Null Comments.png

 

I tried to create a condition on the flow but I failed.. Would like to know what condition I can make for this null to be removed. Kindly advise.

 

Thanks!

4 REPLIES 4
edgonzales
Super User
Super User

@kristinamariz 

Hi there.  I may not completely understand the issue, but it looks like your Parse JSON schema is off near the comments section (extra brackets after "type": ).

 

So, that might cause one kind of error.  The other concern is that Power Automate is particular on received JSON.  When you specify a type, it freaks out a little if it gets anything different.  In this case, you've told it to expect a string...but then it receives a blank value and will send an error.  @JohnLiu has a great article on this action, A Thesis on the Parse JSON action in Microsoft Flow.  Take a look at problem #4 and you might find a more forgiving schema will leave out the string bit:

 

20200820a.PNG

 

Try removing just that one line to see if you still get an error (or if you get a different one).

 

Either way, keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

@edgonzales hope all is well! Thanks for the advice, it will be a good reference for me! I'm trying to remove the null value on the appended comments. I tried to remove the type on the Comment Section as advised. I created a new item to check if the null will be removed but I still get null comments.

 

Null in new created item.png

 

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

 

Kindly advise. Thankie!

Hey @kristinamariz , 

 

I followed the same tutorial and have the same issues. Did you ever get it figured out?

Hi @EJohnson8 , yes so far the appending comments on my end work.

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 (3,341)