File Uploads

  • 22 June 2022
  • 8 replies
  • 195 views

This may be a newbie question - I have a form where a user uploads an image that I want to display on another form. I have the file upload object in my first form and have set it to allow one image only. I have extracted that file from the collection in my workflow. How do I get the URL out of that file object to use it in the second form? 


8 replies

Userlevel 6
Badge +16

Hi @mjs1 


 


How about if you save the image to an online storage in the first workflow?


e.g. OneDrive, Google Drive, Box, SharePoint Online


Then retrieve the image in the second workflow.


 


IF you still want to just pass the URL, perhaps you can save it into a SPO List


 


Question: What is the event or trigger for the second workflow? (aka When do you run the second workflow?)


Question: How do you relate both the workflow?

Userlevel 4
Badge +12

@Garrett great idea on that solution to display the original attachment as an image.


If you use a store a file type action that outputs the URL as part of the object, that would save an extra action from getting the file URL.


 


For example


NWC workflow is start form, image submitted as attachment.


Sharepoint online (SPO) store a file action to a document library.


https://help.nintex.com/en-US/nwc/Content/Designer/Actions/SharePointOnline-StoreaFile.htm


 


This would have an object variable as the output.


You can then reference the file URL from the SPO object in the image control on the task form in an Assign a Task action.


 


The only elements you will need to allow for are the looping around possible multiple attachments and that the person viewing the task form would need permission to the sharepoint document library.


 

So here's the dilemma... For this workflow, is for legal name changes. We want to be able to give the user the option to upload a photo of their driver license to confirm their identity. In the next screen, I want to be able to display that on the approval form for the HR manager to be able to review it and approve the request.


 


I could use a Sharepoint list with an image file type or upload to a file in a library, but how would you retrieve it without making that folder public? 

Userlevel 6
Badge +16

Hey @Gavin-Adams, thanks for the great example to store to SPO document library.


How can we get in touch for a chat?


 


@mjs1 wants the URL variable in the second workflow. Hence that is why I asked how the second workflow is going to be triggered. 


Even if the second workflow is called from the first workflow, I don't think that the variable is passed on (or its passed on but not passed back, can't remember. Platform is Nintex WorkFlow 0365)



 


Hence, I asked how the second workflow is to be triggered. Without knowing that, I don't have enough information to provide a suggestion or solution. 


 


 

Userlevel 4
Badge +12

@mjs1 


As it is an image it will be easier to deal with the file as a document in a document library rather than an attachment to a sharepoint list item.


 


Given the scenario, for review by HR manager, I would create a dedicated site collection in sharepoint online. Only the HR manager needs access to that plus the user account you have for the Sharepoint online library connection. I often create a dedicated Nintex service account in Azure AD and use that account to establish the connections to sharepoint online from NWC. Then I add the nintex service account as a site collection admin or in the site owners group for the site collection.


 


So it would be:



  • NWC start form - employee submits form for change of name with image attached.

  • Workflow, loops through attachments from start form and stores image in document library (HR manager has read access to document library). Store a file action has object output variable

  • Optionally workflow create sharepoint list item in the same site collection if you want of a record of the submission.

  • Assign a task action with task form assigned to HR manager. Task form has image control with reference to file url for SPO store a file object variable.

  • Outcome of task action to approve trigger some business process to complete the name change.


 


For your requirement I do not see a need to have a seperate workflow to display the image to the HR manager.

Userlevel 6
Badge +16

Hi @mjs1 


 


Anyway, you just need a single workflow. What @Gavin-Adams suggests is the better solution for you (Great job!). However do NOT store the image. You can just retrieve the file URL and use it for display in the Task Assign form (for HR Manager).


 


This part below



Source: @Gavin-Adams 


Again, I strongly suggest to NOT store the image.


 


Pls note that the image will still be in this workflow instance. Refer to this video on Business Owner



 


Hope that helps

Badge

In your first form, you have a file upload input where the user uploads the image.
Once the user submits the form, the uploaded file is typically stored in a temporary location or attached to the form data.

In your server-side code (e.g., backend script or API endpoint), you need to handle the file upload and save it to a permanent storage location like a server file system or cloud storage (e.g., Amazon S3, Google Cloud Storage).

After saving the file, generate a unique URL that points to the saved image. The URL should be accessible via HTTP.

In your second form or page, you can pass the image URL as a parameter, hidden input field, or any other suitable method, depending on how your application is structured.
Display the Image in the Second Form:

In the second form, use HTML to display the image using the provided URL. You can use an <img> element with the src attribute set to the image URL.

Badge

The first form has a file upload input where the user uploads an image. When the user submits the form, the uploaded file is usually saved in a temporary location or attached to the form data. Server-side code (e.g., backend script or API endpoint) needs to handle the file upload and save it to a permanent storage location, such as the server's file system or cloud storage (e.g., Amazon S3, Google Cloud Storage). Even driver's licenses are not always issued electronically correctly, although https://drunkid.com/buy/wisconsin-fake-id/ has never come to such a point, it is usually fast and correct. After saving the file, generate a unique URL that points to the saved image. The URL should be accessible via HTTP. In your second form or page, you can pass the image URL as a parameter, hidden input field, or any other suitable method, depending on how your application is structured. In the second form, use HTML to display the image using the provided URL. You can use an <img> element with the src attribute set to the image URL.

Reply