I'm having this problem when i'm passing a *.json file thru' a Web API that starts a process model.
From within my process model i have a readtextfromfile() function in a script task that gets the text from the JSON file.
After this, i use a!fromJson() and save the result in a process variable type: My Data Type.
This however, seems to not be working. The value being passed to the CDT appears to be null and never reaches the write to data entity smart service.
I reckon the cause of this could be that the variable is not holding a list of dictionary required to save as CDT values.
Is there anybody that might have experienced a similar issue and how to solve it?
Thanks in advance!
Discussion posts and replies are publicly visible
I recommend also saving the output of readtextfromfile() into a process variable of Text so you can see what the value is for debugging. It might also be easier to pass the JSON directly in the body of your API instead of as a file.
Yes, agree maybe it come in different than you expect.something like textFile.body.jsonString
We control the format of the JSON input, and:
*readtextfromfile() looks fine in our text process variable (in fact we've manipulated it with multiple versions of quotes and double quotes and still we are not able to process it in the a!fromJSON() function)
*Same JSON passed as body works fine, however the size of the JSON payload exceeds the allowable string lenght of the body and we don't want to create a loop making multiple request when is far simpler to just send the file.
It's hard to beleive that appian supports sending a JSON file but there is no way to read the file and insert it into the Database.
Any other input in terms of what the JSON format has to be to succesfully process with the a!fromJSON() to map to the CDT?
The example provided by Mr. Robert Shankin in this link: https://community.appian.com/discussions/f/data/13238/reading-json-from-json-file?ReplySortBy=CreatedDate&ReplySortOrder=Ascending does not work.
Is this perhaps a product bug in version 20.3 ?
© 2022 Appian. All rights reserved.