How to to get the sub token value of attribute in the JSON response

I am trying to get the (“URL”,“Type”) value for the ContentDocumentLinks token but whenever I am trying to access the token its giving me the below error

Exception has been thrown by the target of an invocation

Query - item.SelectToken(“ContentDocumentLinks.records”).SelectToken(“attributes”).ToString

1 Like

Hi @sanjeetsashank.mohanty
The issue is happening because ContentDocumentLinks.records is an array
Can you try this
item.SelectToken(“ContentDocumentLinks.records[0].attributes.type”).ToString()
item.SelectToken(“ContentDocumentLinks.records[0].attributes.url”).ToString()

Thanks
Akash Javalekar

@sanjeetsashank.mohanty

Welcome to the community

As per structure once converted to jobject..this would work

Variable("ContentDocumentLinks")("records")(0)("attributes").ToString

Cheers

Thanks a lot @Akash_Javalekar1 , @Anil_G , it worked

1 Like

@sanjeetsashank.mohanty

Happy Automation

@sanjeetsashank.mohanty
Great ! Happy Automation!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.