Share via

path d/ does not return value from json dictionary using Sharepoint Designer 2013 web service

Cindy Mello 62 Reputation points
2021-03-18T20:53:06.777+00:00

I am using call

https://services.odata.org/V3/Northwind/Northwind.svc/Customers('ALFKI')?$format=json

I am logging the response and I see values

log the responseVariable {"odata.metadata":"https://services.odata.org/V3/Northwind/Northwind.svc/$metadata#Customers/@Angie Jude &$select=ContactName,CompanyName","CompanyName":"Alfreds Futterkiste","ContactName":"Maria Anders"}

next line in workflow i try to set value from dictionary using d/ContactName from the responseVariable (dictionary) and set to string but there is no value

tried using d/results[0]/ContactName as well nothing returned

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

4 answers

Sort by: Most helpful
  1. Cindy Mello 62 Reputation points
    2021-03-22T01:32:26.41+00:00

    except that in Sharepoint designer using the path did not work, using the Name only did work

    Was this answer helpful?

    1 person found this answer helpful.

  2. Peter Fleischer (former MVP) 19,351 Reputation points
    2021-03-21T21:03:50.7+00:00

    Hi,
    it works very well:

    1. address: https://services.odata.org/V3/Northwind/Northwind.svc/Customers('ALFKI')
    2. RequestHeader: dictionary with accept:application/json;odata=verbose and
      content-type:application/json;odata=verbose
    3. method HTTP GET
    4. in ResponseContent get d/ContactName

    Result: Maria Anders

    Was this answer helpful?

    1 person found this answer helpful.

  3. Cindy Mello 62 Reputation points
    2021-03-19T15:28:49.327+00:00

    I did use that action however the path d/name did not work. Instead if I drop the d/ and use only the name then the value is found.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  4. Amos Wu-MSFT 4,131 Reputation points Moderator
    2021-03-19T03:02:38.487+00:00

    Try to use "Get an Item from a Dictionary" action.
    Reference:Understanding Dictionary actions in SharePoint Designer 2013


    Updated:
    When you want to take a value from the return value, you need to pay attention to the structure of the return value, and take out the corresponding value according to the structure of the return value.
    80029-image.png
    There is no d level in the structure of the API return value.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.