web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Handling multiple file...
Copilot Studio
Unanswered

Handling multiple file uploads and automatic comparison in Copilot Studio topics

(1) ShareShare
ReportReport
Posted on by 2

I’m building a Copilot Studio “Auto PO (Purchase Order) Comparison” topic that should:

 

What I’ve tried so far

I switched to the code editor and have this YAML (stripped down to just the first steps):

 


  1. Automatically detect when a user uploads two files (any mix of PDF/DOCX/XLSX) and immediately start a comparison flow.

  2. Prompt again if they upload fewer or more than two files.

  3. Store the uploaded attachments as an array (turn.uploadedFiles) and pass them to a downstream Power Automate flow.

  4. Render the comparison summary (confidence score, key issues) back in the chat.

  5. Offer a download link for a generated Word report that can be uploaded to our ERP System.

kind: AdaptiveDialog
id: AutoPOCompare
triggers:
  - kind: OnConversationStart
    id: start
    actions:
      # 1) Ask for files
      - kind: Question
        id: AskForFiles
        prompt: "Please upload **exactly two** files for comparison."
        inputType: file[]
        property: turn.uploadedFiles
      # 2) Branch on file count
      - kind: ConditionGroup
        id: CheckFilesCount
        conditionGroups:
          # Exactly two
          - condition: "=length(turn.uploadedFiles) == 2"
            actions:
              - kind: SendActivity
                id: FilesReceived
                activity: |
                  ✅ Received:
                  - File 1: {turn.uploadedFiles[0].name}
                  - File 2: {turn.uploadedFiles[1].name}
                  Comparing now…
              # …later: CallAction to Power Automate, etc.
          # Fewer than two
          - condition: "=length(turn.uploadedFiles) < 2"
            actions:
              - kind: SendActivity
                id: TooFew
                activity: "⚠️ You uploaded {length(turn.uploadedFiles)} file(s). Please upload **two** files."
              - kind: GoToDialogStep
                dialogStepId: AskForFiles
          # More than two
          - condition: "=length(turn.uploadedFiles) > 2"
            actions:
              - kind: SendActivity
                id: TooMany
                activity: "⚠️ You uploaded {length(turn.uploadedFiles)} files. Please upload **exactly two**."
              - kind: GoToDialogStep
                dialogStepId: AskForFiles
 

Errors I’m seeing

  1. “Response variable is missing” on the Question step:

    • The GUI shows red text: InvalidPropertyPath / Response variable is missing.

  2. “’Conditions’ cannot be empty” on the ConditionGroup step.

  3. When I switch back to the visual designer, it complains:

    • Missing required property Entity on the Question card.

    • The visual question node only lets me choose a built-in “Var1/Var2” file variable, and I can’t rename or bind it to turn.uploadedFiles.

  4. If I try attachments.count instead of length(turn.uploadedFiles), it says that property doesn’t exist.



  5.  
 
 

What I need help with

  1. Correct YAML schema for a file-upload Question that collects multiple attachments into a topic variable (e.g. turn.uploadedFiles).

  2. How to reference that array in a ConditionGroup without “empty collection” errors.

  3. The minimal Entity/inputType/property settings that satisfy Studio’s validation.

  4. Any Studio UI steps I’m missing to define a new topic‐scoped array variable for files.

  5. Confirm whether automatic triggering on two uploads (without an explicit user utterance) is supported, and if so, how to configure it.

I can attach screenshots of the errors and my current topic layout if needed. Any pointers, sample YAML, or documentation links would be hugely appreciated!

I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    Please share, not just explain what you are doing. Its too difficult to visualize and try to tell you what is wrong without seeing it.
     
    Also, I would suggest that you have a topic that asks them for the files, not just lets them drop whatever, as it makes it much easier to attach to a question and ensure that anything else they upload you do not care about as you already captured the 2 things and saved them.
     
    Other than that, please share pictures of the configuration, flows, and anything else along with errors and if those errors in the Tool (aka flow) please share the flow run, with action values etc.
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 599

#2
chiaraalina Profile Picture

chiaraalina 170 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 118

Last 30 days Overall leaderboard