0

I want to use ajax with rest api in order to get workflow tasks of a user. I use this:

_spPageContextInfo.webAbsoluteUrl + "/_api/web/Lists/getByTitle('Workflow%20Tasks')/items?$filter=WorkflowName eq '" + workflowNameShort + "'"

address in order to get tasks of workflow name. when I add "assign to" - I get error that "assign to" is not existed field.

What could be the problem?

  • Can you share your code.. – Rohit Waghela Mar 26 '18 at 9:40
  • assign to's internal name probably differs from its written format. I suggest to use e.g. Fiddler to see contents of the parent object in a JSON call. Alternatively you can look up for the assign to column in your SP, go to the column's settings and see what is the column's written format in the URL of the page. If you are a bit unsure about what to look for in the 2nd approach, go with the 1st. – moe Mar 26 '18 at 9:50
4

The AssignTo field is people/group field so we need to expand the field to get information from the field and in rest we need to specify the internal name of the field not the display name example in place of Assign To must be AssignTo

_spPageContextInfo.webAbsoluteUrl + "/_api/web/Lists/getByTitle('Workflow%20Tasks')/items?$select=AssignedTo/Title&$expand=AssignedTo&$filter=WorkflowName eq '" + workflowNameShort + "'"
  • You can add some explanation along with your code. That really helps. – Ankitkumar Malde Mar 26 '18 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.