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):
-
Automatically detect when a user uploads two files (any mix of PDF/DOCX/XLSX) and immediately start a comparison flow.
-
Prompt again if they upload fewer or more than two files.
-
Store the uploaded attachments as an array (
turn.uploadedFiles) and pass them to a downstream Power Automate flow. -
Render the comparison summary (confidence score, key issues) back in the chat.
-
Offer a download link for a generated Word report that can be uploaded to our ERP System.
id: AutoPOCompare
- 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
- 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.
- 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
- 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
-
“Response variable is missing” on the
Questionstep:-
The GUI shows red text:
InvalidPropertyPath/Response variable is missing.
-
-
“’Conditions’ cannot be empty” on the
ConditionGroupstep. -
When I switch back to the visual designer, it complains:
-
Missing required property
Entityon 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.
-
-
If I try
attachments.countinstead oflength(turn.uploadedFiles), it says that property doesn’t exist.
What I need help with
-
Correct YAML schema for a file-upload Question that collects multiple attachments into a topic variable (e.g.
turn.uploadedFiles). -
How to reference that array in a ConditionGroup without “empty collection” errors.
-
The minimal
Entity/inputType/propertysettings that satisfy Studio’s validation. -
Any Studio UI steps I’m missing to define a new topic‐scoped array variable for files.
-
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!

Report
All responses (
Answers (