K2 form Query - Auto-load attachment/file.

  • 25 April 2022
  • 6 replies
  • 105 views

Hi All,

 

I am relatively new to the domain of K2 so please bare with my silly questions. 

My query is that I need to know if there is any solution for K2 control to kind of auto-load the document which has been recently scanned and saved on to the local PC. I know this is a very complicated requirement that we are trying to implement.

So if any one have any solutions to this, please do let me know.

Thankyou.


6 replies

Userlevel 3
Badge +9

What do you mean by auto-load in this context?


 


Show it in the browser?


 


Upload it to a server for further processing?


 


Cheers

Hi Paul,

By auto-load, what I meant is that the attachment file control in the K2 form should be able to get hold of the most recently scanned document which would be saved in local PC folder. And yeah it would be reflected on the browser where the form is opened.

So if the user scans a document of certain type, it would save in a particular folder from which the form would sort of auto-load it once the form is initialized.

Userlevel 3
Badge +9

Hi


 


I don't think what you are attempting to do would be possible as you can't tell the file control to populate (without a user uploading a file to the control) a file that doesn't come from a SmartObject property, also displaying user files in the browser without them being served up from some kind of web server would be difficult.


 


The closest I have done in the past is to scan the files to a shared directory then use some code to read the files in that directory (I think there's a file reading service broker that you could use in conjunction with a workflow) and save them in to SharePoint, which you can then use to display them.


 


This obviously isn't ideal and there would be some lag in this and is pushing all the files to the server.


 


Cheers


 

Hi Paul,

Thankyou for the response.

Even I reckoned the same as you pointed out with the inability of the control to populate the document/file.

Now as an alternate step, I was instructed by my superior to see if we could add a button so that the scanner (connected to PC) would scan the file and then the resultant file would be picked up (as agreed we need to link it with server in order to pickup the file)

Now this button to scan must be created using other languages like jQuery but is it possible? Since my knowledge in K2 very limited I cant really find a solution for this.
I hope you could help me with a solution or even with a next-best solution. Once again thanks a lot.

Regards.
Userlevel 3
Badge +9

You could use the K2 web apis for starting processes: https://help.nintex.com/en-US/k2five/devref/5.5/default.htm#Runtime/WF-REST-API/WF-REST-API.htm 


 


Examples here: https://help.nintex.com/en-US/k2five/devref/5.5/default.htm#Runtime/WF-REST-API/Workflow-REST-API-Samples.htm 


 


And if you use the file service: https://community.nintex.com/t5/K2-Five-blackpearl/File-Service-Broker-v2-0/ta-p/177198 as part of that process you could read the file from a share and do what you want with it.


 


Cheers

Thanks for the help. I will follow the article and let me see it would help me achieving my objective.

I will update on the forum if the above steps works.

Thankyou once again for all the help.

Reply