Skip to main content
purushottamr3045
January 6, 2025
Question

Document Upload- WebAPI

  • January 6, 2025
  • 12 replies
  • 0 views

I have a requirement where user can pass document and it gets uploaded to an Appian's folder. I have created a WebAPI (Document Upload) and positive scenario is working as expected.

For Negative Scenario (When we are not passing any document):

1. In the WebAPI , it is handled as "400- Document not provided" but when testing we are getting status-200 (Untitled document from web API.txt).

Q. From where we are getting this "Untitled document from web API.txt" document. Where is it handled?

Q. How to fix default handling?

12 replies

venkatrea696188
January 6, 2025

In negative scenario what's the value of local!success is it really giving you false?? I doubt that Can you check it once, It went for true statement in if condition that means it's true to start with. So try adding one more condition like checking length of the array etc.,
 

purushottamr3045
January 6, 2025

Thanks [mention:ba9672c2f5294cb98c0a2b8fb79cf967:e9ed411860ed4f2ba0265705b8793d05] ,

I don't see any option to see local!success . However, I did fixed it by checking the size of the request.body.

I am just trying to figure out Appian is not taking the body as empty and from where "Untitled document from web API.txt" is being handled?

Sharing test-results from Postman

"

venkatrea696188
January 6, 2025
is not taking the body as empty

Empty Array returns false (Documented ) https://docs.appian.com/suite/help/24.4/fnc_informational_isnull.html .

from where "Untitled document from web API.txt" is being handled?

And coming to this it's taking true in if statement and trying to creating a Document for Empty values

stefanhelzle0001
January 6, 2025

Did you consider to use a!isnullorempty() instead of isnull()? This is the more modern approach and manages more of the edge cases.

purushottamr3045
January 7, 2025

Yes [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] ,

I did try and the result was same. However I just don't see anywhere documented that if we don't send any document, Appian is going to create a document by itself and upload it. 

Trying to understand whether it's a bug or it's the way it is handled. Even, I don't see where "Untitled document from web API.txt" is being handled.