question

cindymello-1540 avatar image
0 Votes"
cindymello-1540 asked saldana-msft edited

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

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\/@Element&$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


sharepoint-workflow
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cindymello-1540 avatar image
0 Votes"
cindymello-1540 answered AmosWu-MSFT edited

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

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
I didn't unterstand your answer. Which path? Which Name?

0 Votes 0 ·

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.
And I have updated my first answer, if my first answer helps you, please accept it as the answer. Thank you:).

0 Votes 0 ·
image.png (47.5 KiB)
AmosWu-MSFT avatar image
0 Votes"
AmosWu-MSFT answered AmosWu-MSFT edited

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cindymello-1540 avatar image
0 Votes"
cindymello-1540 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PeterFleischer-3316 avatar image
0 Votes"
PeterFleischer-3316 answered PeterFleischer-3316 edited

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

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes that all works my question was for Sharepoint designer and the call http action and how the path d/name did not work HOWEVER dropping the d/ and using only the name ContactName does work.

0 Votes 0 ·

Hi,
you need to pay attention to the structure of the return value:

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

https://services.odata.org/V3/Northwind/Northwind.svc/Customers('ALFKI')
in ResponseContent get d/ContactName

https://services.odata.org/V3/Northwind/Northwind.svc/Customers
in ResponseContent get d/results(0)/ContactName

0 Votes 0 ·