Cannot convert a primitive value to 'Edm.Guid'
Good morning everyone.
Currently I'm trying to send an attachment to a case through one of our platforms. To do so, I'm creating the task first to get the CaseId to attach the file to. When trying to collect the CaseId, I get it as a String. I'm trying to POST this action and i get an error: "Cannot convert a primitive value to the expected type 'Edm.Guid'. How do I cast this string to Guid through Postman?
Thanks in advance.
Like
Dear Ramon,
Maybe you should try to get the value of CaseId is Edm.Guid instead of String as CaseId is an unique identificator and should be Guid type.
Here are academy article that can help you:
https://academy.bpmonline.com/documents/technic-sdk/7-13/working-bpmonl…
https://academy.bpmonline.com/documents/technic-sdk/7-13/examples-reque…
Also you can try converting string value to Guid. You can find a related question in stackoverflow:
https://stackoverflow.com/questions/350500/how-to-try-convert-a-string-…
Best regards,
Oscar
To cast a string to guid for posting to OData, you can specify it by adding guid in front of the string, like this:
For a filter:
$filter=CaseId eq guid'2cddff96-6346-4fa8-8c37-2a4325cf6bd6'
Or for a single entity
CaseCollection(guid'2cddff96-6346-4fa8-8c37-2a4325cf6bd6')
Ryan