Call HTTP Web Service: REST call to update an item

  • 26 November 2015
  • 8 replies
  • 26 views

Badge +2

For a Nintex for O365 workflow,

I'm looking for an example to update an item in a list via the HTTP Web Service action.

Started with the below settings of the used dictionaries but run into an error.

Any ideas?

 

Thanks!

 

Address:

https://<tenant>/sites/DocuSign/_api/lists/getbytitle('MyList')/items?$filter=(Title%20eq%20'itemtoselect')

 

Request Type: POST

Request Headers:

146751_pastedImage_2.png

 

Request Content:

 

146752_pastedImage_3.png

146754_pastedImage_6.png

 

 

Log:

146755_pastedImage_7.png


8 replies

Userlevel 6
Badge +16

Have you seen this post? >>> Jason Lee's Blog: Getting and Setting Managed Metadata Fields in SharePoint 2013 Workflows

Badge +2

Hi Fernando,

Thanks for the feedback but the value I want to update is just a list column not a managed metadata field

Badge +7

Hi,

I found this link really helpful when I was doing this, How to execute a REST API request with Nintex Workflow

Jan

Badge +2

I also found that info and it's definitely a good start, only this is for Nintex for O365 where the actions are different...

Userlevel 5
Badge +9

Have you tried using this url :

https://<tenant>/sites/DocuSign/_api/lists/getbytitle('MyList')/items ?

Badge +4

Hi,

 

For updating an item the X-RequestDigest field is mandatory. Make a first web request on the url : Web URL/_api/contextinfo (POST / Content type : text/xml) and store result in a multiline text. Extract the digest value with an action Query XML on the result with XPATH /d:GetContextWebInformation/d:FormDigestValue. Now you have your digest value.

 

Make your second web request on the following URL : siteURL/_api/lists/workflowtasks/items(itemID)?$select=ID

And put all this headers for the POST method :

    - Accept: "application/json;odata=verbose"

    - Content-Type : "application/json;odata=verbose"

    - IF-MATCH : "*"

    - X-HTTP-Method : "MERGE"

    - X-RequestDigest : your digest value

 

Set the body of your request, for exemple :

     '__metadata': { 'type': 'SP.Data.WorkflowTasksItem' },

       'DueDate':newDueDate.toISOString()

Badge +3

What would need to change to use this to update the Internal Name of the Name field within the current list that workflow is running on?  I can get the Request Digest Value but when attempting post it's failing.

{

'_metadata" : {'type' : {WorkflowVariable: ListItemEntityTypeFullName}'},

'FileLeafRef' : {ItemProperty:NewFolderName}

}

Userlevel 5
Badge +9

Hi,

Can you share the url of your query?

Regarding the body of your query :

  • there should be two underscore '_' before 'metadata'
  • you've added two single quotes after 'metadata' instead of one
  • a single quote is missing before your reference to your workflow variable ListItemEntityTypeFullName
  • you should add a single quote before and after your reference to your workflow variable NewFolderName

The body should look like this :

{

'__metadata' : {'type' : '{WorkflowVariable:ListItemEntityTypeFullName}'},

'FileLeafRef' : '{ItemProperty:NewFolderName}'

}

Hope this helps

Reply