Forum Discussion
Hello,
I am getting below error when writing above expressions in HTTP Entity:
failure:
“HTTP Entity: Cannot lookup a property on a null value”
value:
“Please check expression syntax and data types.”
reason:
“Please check expression syntax and data types.”
I have created a REST POST basic auth account with username and password.
Do you have any suggestion?
Thanks,
Aditya
- christwr7 years agoContributor III
Also, if I take the raw BASE64 data from Salesforce and decode it with “base64 -d” it decodes just fine, like the bottom branch decodes it just fine (twice).
- tstack7 years agoFormer Employee
Can you give a little more information on the configuration of the “REST GET_FILE” snap? Is it a REST Get snap with the response type set to BINARY? Or, is the response type set to TEXT and $entity is a string?
- christwr7 years agoContributor III
Hi Tim,
The REST GET is setup with response type BINARY which puts the BASE64 encoded data into the entity field with a “_snaptype_binary_base64”, which I can’t decode directly with the Base64.decodeAsBinary($entity) function.
However, if I BASE64 decode it with the Document-To-Binary snap and then re-BASE64 encode it with the Binary-To-Document snap, I end up with the same BASE64 data in a content field, without any “_snaptype_binary_base64”, which then decodes fine with the Base64.decodeAsBinary($content) function.
- tstack7 years agoFormer Employee
Sorry, for the confusion, but I think the data is already binary (a byte array internally). The “_snaptype_binary_base64” is how the byte array is stored as JSON for preview. Have you tried just using
$entity
in the REST POST snap?
- christwr7 years agoContributor III
Hmm… I wonder how the DECODE BASE64 on the lower branch works then?
I’ll mess with it more.
- tstack7 years agoFormer Employee
It might not be doing anything at all since it’s already a byte array.
- jayakrishnan_va7 years agoNew Contributor
Hi @christwr , I believe that the base64 encode-decode inbuilt functions has some limitations and the encoding-decoding doesnt support all characters.
In the second approach i guess the data is not being transferred as it is supposed to be even though its working (please verify it).my suggestion: use a script snap with python code for base64 encoding and decoding functionality.
Thanks.
- tstack7 years agoFormer Employee
What limitations have you found there to be? The functions were failing in this case because they were being passed raw binary data and not base64-encoded strings.
Related Content
- 11 months ago
- 10 months ago
- 2 years ago