cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PamelaReeve27
Frequent Visitor

How to add several attachment for approval (various file type)

I've tried to create approval with attachment by manually trigger a flow with input file content more than 1 file (I added 2 file content for input) then try testing. it fail many times for property as show 

"InvalidTemplate. Unable to process template language expressions in action 'Start_and_wait_for_an_Pre-approval' inputs at line '1' and column '2837': 'The template language expression 'triggerBody()['file_1']['contentBytes']' cannot be evaluated because property 'file_1' doesn't exist, available properties are 'text, date, text_1, number, email, email_1, file, text_2, email_2'. Please see https://aka.ms/logicexpressions for usage details.'."

 

sorry, I can't even know how to add image for my drafting flow

 
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JohnAageAnderse
Super User
Super User

Hello @PamelaReeve27 

The output from your trigger includes references to your files. The ID of File_1 is file, the ID of File_2 is file_1 - yes confusing 🙂

I made a small test and came up with this! Output from the trigger with two files defined as input - File_1 and File_2 - gives:

 

{
  "type""object",
  "properties": {
    "file": {
      "title""File_1",
      "type""object",
      "x-ms-dynamically-added"true,
      "description""Please select file or image",
      "x-ms-content-hint""FILE",
      "properties": {
        "name": {
          "type""string"
        },
        "contentBytes": {
          "type""string",
          "format""byte"
        }
      }
    },
    "file_1": {
      "title""FIle_2",
      "type""object",
      "x-ms-dynamically-added"true,
      "description""Please select file or image",
      "x-ms-content-hint""FILE",
      "properties": {
        "name": {
          "type""string"
        },
        "contentBytes": {
          "type""string",
          "format""byte"
        }
      }
    }
  },
  "required": []
}
Observe how the objects are named - "file" = "File_1" and "file_1" = "File_2" - the name you gave are only the display names 🙂
Hope this helps you on the way. Kind regards, John

View solution in original post

2 REPLIES 2
JohnAageAnderse
Super User
Super User

Hello @PamelaReeve27 

The output from your trigger includes references to your files. The ID of File_1 is file, the ID of File_2 is file_1 - yes confusing 🙂

I made a small test and came up with this! Output from the trigger with two files defined as input - File_1 and File_2 - gives:

 

{
  "type""object",
  "properties": {
    "file": {
      "title""File_1",
      "type""object",
      "x-ms-dynamically-added"true,
      "description""Please select file or image",
      "x-ms-content-hint""FILE",
      "properties": {
        "name": {
          "type""string"
        },
        "contentBytes": {
          "type""string",
          "format""byte"
        }
      }
    },
    "file_1": {
      "title""FIle_2",
      "type""object",
      "x-ms-dynamically-added"true,
      "description""Please select file or image",
      "x-ms-content-hint""FILE",
      "properties": {
        "name": {
          "type""string"
        },
        "contentBytes": {
          "type""string",
          "format""byte"
        }
      }
    }
  },
  "required": []
}
Observe how the objects are named - "file" = "File_1" and "file_1" = "File_2" - the name you gave are only the display names 🙂
Hope this helps you on the way. Kind regards, John

View solution in original post

Hi @JohnAageAnderse 

  Thank you. OK, it's about file name not match. Previously I thought it missing properties so I tried to add properties but don't know how to. 

  However I delete action of add input file and re-do then define file name as you mentioned. It's work! thank you very much. Be safe and be healthy, Pamela

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,471)