Skip to main content
Nintex Community Menu Bar

Call HTTP Web Service: REST call to update an item

  • November 26, 2015
  • 8 replies
  • 90 views

Forum|alt.badge.img+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

Forum|alt.badge.img+16
  • November 27, 2015

Forum|alt.badge.img+2
  • Author
  • November 27, 2015

Hi Fernando,

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


Forum|alt.badge.img+7
  • November 27, 2015

Hi,

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

Jan


Forum|alt.badge.img+2
  • Author
  • November 27, 2015

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


Forum|alt.badge.img+9
  • Nintex Partner
  • December 1, 2015

Forum|alt.badge.img+4
  • Nintex Partner
  • December 3, 2015

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()


Forum|alt.badge.img+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}

}


Forum|alt.badge.img+9
  • Nintex Partner
  • May 29, 2017

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