Caldera Forms Upload Directory Based on Filename

Edifice upon our previous post regarding how to Convert Microsoft Forms Responses to Give-and-take or PDF Documents

Nosotros had an interesting question this calendar week asking how to embed image files submitted in a Microsoft Forms response into either a Word or PDF Document created from HTML … hmmm. Whilst we rapidly worked this through (and this post covers how) we likewise identified some other scenario which this post also covers:

  • Uploading Files provided in a Microsoft Forms response to a SharePoint Library
  • Convert a Microsoft Forms response to PDF or Word and embed fastened image files.

Uploading Files provided in a Microsoft Forms response to a SharePoint Library

This mail service assumes y'all have already created your Microsoft Form and added a question to permit the responder to adhere a file(s) to the response:

1. Launch Power Automate – https://powerautomate.microsoft.com

2. Create a new Menses using the 'Automated — from blank' pick

3. Enter a name for the Flow, select the 'When a new response is submitted' Forms trigger, click 'Create'

The Form I will employ for testing contains the post-obit question, note that I have specified that the user can upload three separate files.

4. Select the target grade

5. Add a 'Get Response Details' action

v.a. Course ID: Select the form as per step 4

5.b. Response Id: Select the 'List of response notifications Response Id' from the 'When a new response is submitted' action

half-dozen. We now need to test the course as nosotros need an case response (data) to help united states to build the residual of the Flow. Test your Flow and create a response containing some case files, once the examination has completed, select the 'Go response details' activity

vii. Copy the return value (JSON) for the question which contains the uploaded files.

viii. Add a 'Parse JSON' activeness

8.a. Content: Select the question which relates to the value copied in step #7

8.b. Click 'Generate from sample'

viii.c. Paste the value copied in footstep #7, click 'Done'

8.d. Action configuration consummate

When files are uploaded via Microsoft Forms they are placed into your OneDrive Folder following this convention:

/Apps/Microsoft Forms/<Grade proper name>/Question/

Nosotros're now going to recollect each file, catechumen them to PDF and upload them to SharePoint for long term preservation:

nine. Add a OneDrive 'Get file content using path' action

9.a. File Path: Manually enter the directory location where the files volition be uploaded

ix.b. File Path: Place your cursor at the stop of the manually entered path, so select the 'name' holding provided by the 'Parse JSON' action

This volition automatically place the OneDrive 'Get file content using path' activity into an 'Employ to each' loop every bit the returned value is an assortment (even if information technology but contains i file).

10. (Optional) Add an Encodian 'Convert to PDF' activity

10.a. Filename: Select the 'proper noun' property provided by the 'Parse JSON' activeness

10.b. File Content: Select the 'File content' property provided by the 'Go file content using path' action

ten.c. PDF Filename: Select the 'proper name' belongings provided by the 'Parse JSON' action

11. Add a SharePoint 'Create File' activity

11.a. Site Address: Gear up to the target SharePoint site

11.b. Folder Path: Prepare to the target SharePoint library and binder

xi.c. File Name: Select the 'Filename' field from the 'Convert to PDF' activeness

11.d. File Content: Select the 'File Content' field from the 'Convert to PDF' action

All done! The documents will now exist converted to PDF and uploaded to the selected destination in SharePoint!

Convert a Microsoft Forms response to PDF or Discussion and embed attached image files

This post is already quite lengthy! so for this specific scenario please too refer to the post-obit mail service which outlines how to convert a Microsoft Forms response into either a PDF or Word document: Convert Microsoft Forms Responses to Discussion or PDF Documents

For this section, we'll focus on how to obtain an epitome file and catechumen to a dataUri then that information technology tin can be embedded into an HTML document. I have also configured the grade question to just permit a single file to exist uploaded, I recommend this approach as information technology simplifies your Flow when placing images in documents.

1. Echo steps 1 to eight in the 'Uploading Files provided in a Microsoft Forms response to a SharePoint Library' department of this post

2. Add a OneDrive 'Become file content using path' action

2.a. File Path: Manually enter the directory location where the files will be uploaded

2.b. File Path: Identify your cursor at the end of the manually entered text, click 'Expression' and and so enter the post-obit expression and click 'OK'

first(body('Parse_JSON'))?['name']

The following Encodian action is optional; if added it will enable you lot to resize the uploaded prototype to a specific or percentage size prior to creating the dataUri for embedding in HTML

3. (Optional) Add together an Encodian 'Resize an Image' Action

3.a. Filename: Enter the following expression

first(body('Parse_JSON'))?['proper noun']

3.b. File Content: Select the 'File content' property provided by the OneDrive 'Become file content using path' action

3.c. Resize Blazon: Select 'Percentage'

3.d. Resize Percentage: Enter '50'

iii. Add a 'Compose' action

3.a. Inputs: Click 'Expression', enter i of the post-obit expression's and so click 'OK'

If you added the Encodian action enter:

          dataUri(base64ToBinary(trunk('Resize_an_Image')?['FileContent']))        

If you did non add the Encodian action enter:

dataUri(body('Get_file_content_using_path'))

All done! The 'Compose' action will return a dataUri which can be used to embed an paradigm inside HTML prior to conversion to HTML or Word, for case:

Final thoughts…

Hopefully, this post non only provides some skillful guidance for the specific scenarios covered, it should also (hopefully) provide some general steps which y'all can adapt and utilise in your own Flow's when working with file(s) provided by a Microsoft Forms response.

We hope you've found this guide useful, as ever please share any feedback or comments, all welcome!

cardilloenty1981.blogspot.com

Source: https://www.encodian.com/blog/handling-files-provided-in-a-microsoft-forms-response/

0 Response to "Caldera Forms Upload Directory Based on Filename"

إرسال تعليق

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel