Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
20 replies
Subscribers
7 subscribers
Views
5386 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
issue with getdocumentsfromfolder function
garym
over 7 years ago
Hi,
The getdocumentsfromfolder function seems straightforward but for some reason, it is not returning any documents when being used in one of our processes.
I have a sub-process which is being passed the folder in a pv called pv!requestFolder. I can see this folder in our documents tab and there are documents in it. This folder is called "SC-2016-00177". The sub-process calls the getdocumentsfromfolder function and saves the output into a pv of type documents (multiple).
getdocumentsfromfolder(
rootFolder : pv!requestFolder ,
recursiveSearch : true()
)
In the process, I can see that the value of the folder has been passed properly to a pv of type folder and the value is SC-2016-00177.
However, when the expression runs, it doesn't return the list of documents.
The security on the folder is correct.
Even when I try to run this in an expression rule, I can't get the list of documents to be retu...
OriginalPostID-251463
Discussion posts and replies are publicly visible
0
Poorna Guduri
A Score Level 1
over 7 years ago
Thanks Gary for updating the issue and thanks to Ramesh as well for pointing to the article.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Luke Schurman
Appian Employee
over 7 years ago
getdocumentsfromfolder doesn't support keyword syntax
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Poorna Guduri
A Score Level 1
over 7 years ago
Is it really so? I could see proper results even with the keyword syntax. Please find the snapshot for reference.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
@poornah It may seem to you that it's working but it won't work as intended provided if you perform some more testing(just reverse the order of arguments and see what happens). Please find attached the picture and you can understand the difference. In the first example, though you pass the values by keyword, the function still takes first argument as folderId(casting the value of false to 0) and retrieving all the documents that are in the folder that has 0 as id. You won't observe this kind of behavior with system functions or expression rules.
At a high level it appears that we are making use of 'by keyword' approach, but behind the scenes it's actually making use of 'by position' approach.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 7 years ago
1. If the issue is the "Pending approval" then the solution is to disable that constraint within the KC that contains the folder.
If that doesn't work refer to
forum.appian.com/.../kb-1192.html
That should make the documents searchable.
2. Another option is that the KC containing the folders is marked as "Hide from search results" which you can also disable in the KC properties.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
@Eduardo - How do you disable the constraint within the KC that contains the folder?
Also, for the article that you mentioned, the Remove Approval Required smart service expects a folder as the input. How would I remove the approval required at the KC level?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
@Eduardo - OK I think I understand now. Basically, use this Remove Approval Required smart service after any add folder task to ensure that the approval required is false. Is that what needs to be done?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 7 years ago
For the KC level change (faster) you can do what I described in the attached screenshot.
If that doesn't work you can try the plug-in passing this particular folder to confirm the issue is what is explained in the article.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
@Eduardo - those 3 options were all disabled already
I just approved the documents that were in the folder to get it working. However, for future folders being created, I am assuming they will still require approvals so does that mean whenever I create a folder in the process, I should use the Remove Approval Required smart service afterwards to make sure that it is disabled?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 7 years ago
If the options were disabled already there are two possible situations:
1. The options were disabled AFTER the documents had been already created thus they remained as "pending approval". This is possible because disabling the checkbox doesn't auto-approve the pending approval documents
2. Or you're facing the issue from KB article
forum.appian.com/.../kb-1192.html
NEXT STEPS
1. For #1 above, can you try uploading new files to check if they are found now? IF they are then the issue is resolved.
2. If not resolved for new documents then that's right you'll have to run "Remove Approval Required" after creating a folder if:
---> You're creating the folder with a custom plugin
---> You're creating the folder in a KC that has those checkbox enabled but then moving the folder with a smart service
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<