Skip to content

[BUG] Add-PnPListItemComment - format-default: Exception has been thrown by the target of an invocation. #3855

Answered by aquaus
aquaus asked this question in General
Discussion options

You must be logged in to vote

@gautamdsheth Code away! :-D

My workaround to the situation is to leverage Power Automate / Logic App and target the API directly.

I successfully reproduced the issue by using this content type:
"content-type": "application/json;charset=UTF-8"

The issue was resolved after using this content type:
"content-type": "application/json;odata=verbose"

::Working::
params:
{
"dataset": "https://yourtenant.sharepoint.com/sites/DemoSite",
"parameters/method": "POST",
"parameters/uri": "_api/web/lists/GetByTitle('Demo List')/items(9)/Comments",
"parameters/headers": {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
},
"parameters/body": "{\n "__metadata": …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@SabbeRubbish
Comment options

@HensHub
Comment options

@aquaus
Comment options

@HensHub
Comment options

Answer selected by aquaus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants
Converted from issue

This discussion was converted from issue #3854 on March 27, 2024 12:10.