cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pardee
Regular Visitor

Sending multiple upload FIELDS from forms as outlook file attachments

I have a form using an upload field and I understand the method using arrays to send multiple attachments and it runs perfectly fine.

 

However what I would like to do is have several upload sections through the form sent as attachments 

 

Example:

Section 1

Name

Date

Upload Field 1

 

Section 2

Address

Phone

Upload Field 2

 

And then in my email have attachments from both Upload field 1 and upload field 2

 

Current working version with ONE upload field (upload field named "Question")

Spoiler
Pardee_0-1660052559895.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Community Champion
Community Champion

Hi @Pardee 

 

I would initialize a variable of type array and append all elements (from both arrays) to it.

 

Then use that variable as the parameter for the attachments.

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
Otherwise, reply to it, and the community will do its best to help you.

View solution in original post

9 REPLIES 9
manuelstgomes
Community Champion
Community Champion

Hi @Pardee 

 

It's possible to have multiple upload fields in your forms. Just add them with different questions:

Screenshot 2022-08-09 at 16.43.48.png

 

After this, you have the fields to parse in Flow. They will appear in Power Automate with the same names as the questions, but I think they will always be arrays of elements, not only one element. I haven't tested this, but I think this will happen even if you define that you only want one file.

 

Is this what you need?

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
Otherwise, reply to it, and the community will do its best to help you.

 

 

I am capturing the file from the second upload I just simply need to add it to the attachments/email

 

This is my form

Pardee_1-1660057799922.png

 

 

This is the array used for the first upload field, only one variable is allowed per attachment which means I can not duplicate process and add another array and the image from the second upload is not included with the flow as is. (Note the full flow is in OP)

Pardee_2-1660057862927.png

 

 

This is the JSON Parse Schema I have

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "type": {},
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            },
            "uploadSessionUrl": {}
        },
        "required": [
            "name",
            "link",
            "id",
            "type",
            "size",
            "referenceId",
            "driveId",
            "status",
            "uploadSessionUrl"
        ]
    }
}

 

 

 

 

Is there something I can do to include the additional upload in this array?

 

In the end I anticipate about 5 separate upload fields required on this form I would like to be attached or included inside the email

 

(If I call the element question 2 in the body of the email I get all the metadata, if I could clear that out and take the link and have html format it into an image that would work as well)

 

manuelstgomes
Community Champion
Community Champion

Hi @Pardee 

 

I would initialize a variable of type array and append all elements (from both arrays) to it.

 

Then use that variable as the parameter for the attachments.

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
Otherwise, reply to it, and the community will do its best to help you.

Both have been initialized as arrays but are being output to a string when I am trying to declare them as an array. Am I missing a step, do I need to concatenate or something? I am unfamiliar with the visual syntax flows use 

 

Pardee_0-1660062572403.png

 

Pardee_1-1660062629542.png

 

manuelstgomes
Community Champion
Community Champion

Hi @Pardee 

 

You have two array variables (The "multiple attachments" and "question 2"). Remove one of them and attach all (from questions 1 and 2) to the same variable. Then use that one on the email.

 

Cheers
Manuel

------------------------------------------------------------------
If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
Otherwise, reply to it, and the community will do its best to help you.

AshleaLu
Helper II
Helper II

Hi All,

 

I too am having the same issue. I have a form with multiple fields that require uploads. I can upload one to email but not the rest. I tried doing multiple parse JSONs but I think that just screwed everything up. I am self-taught in powerautomate so I do need a bit of spoon feeding. Can someone help me out??

AshleaLu_0-1667962393957.png

 

Pardee
Regular Visitor

Pardee_0-1667994827961.png

 

Pardee_1-1667995040328.png

 

Then under the send from sharebox dropdown, go to advanced options and ensure your attachments are set up correctly:

Pardee_2-1667995116840.png

 

Thank you,

I am trying to execute this now.

In condition 2 (under initialize variable 2)

what do I put in there?

I wouldn't put anything there, that is just a conditional variable in my form that chooses which email group and format to send the content in.

 

If you want to be safe you can just leave the conditional as a true and leave the false blank or even remove it though I have note tested the flow without it...which should not matter, you know... code.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,611)