Just an update here:
Was told that the developers said passing files from one workflow to a component workflow wasn't supported (other than passing an entire collection). While trying to determine how to pull a specific file out of a collection, we determined that this actually was possible.
I used the following Query Json action to get the actual text reference to a specific file:
Signed Files: A collection of files (in this case returned from DocuSign)
TargetFileName: The name of the file I want to pull out of the collection
TargetFileJson: This will be the JSON reference to the file
After that action runs, I'm able to pass the TargetFileJson text variable to a component workflow's file input. That component workflow is then able to make use of the actual file from the parent workflow.
Also useful (and the point of my latest case with Nintex), you can use the following "Check if item exists in collection" action to get the index for a specific file out of a collection:
Signed Files: A collection of files (in this case returned from DocuSign)
TargetFileJson: Result of the Query Json action above
JSONFileFound: Boolean result of whether the file was found
TargetJSONIndex: The index in the collection where the desired file is
This could get be followed with the Get Item from Collection, using the Collection variable and the Index result above to pull the desired file out of a collection.
@bsikes
that's very helpful thanks.
For reference could you post as text in a reply the jsonpath expression?
That looks very handy and would like to avoid mistyping it.
Thanks
Sure thing:
$[?(@ =~ '/.*fileName":"DesiredFileName"/I')]
Thanks for sharing your solution @bsikes! Thinking outside the box on this one for sure.
@Gavin-Adams
After some further testing, I found that attachments uploaded as part of a NWC Form are stored in the collection a bit differently than those returned from a third party (Or at least DocuSign). Seems like certain characters are percent encoded, which breaks the expression ('=' : %22, ':' = %3A)
This updated JSON Path expression seems to hit both types correctly:
​$‹?(@ =~ '/.*fileName((?=":"TargetFileName)|(?=%22%3A%22TargetFileName))/I')]​