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!

2 REPLIES 2
edgonzales
Super User II
Super User II

@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!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (39,483)