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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Split Forms / Attachme...
Power Apps
Unanswered

Split Forms / Attachment Control

(0) ShareShare
ReportReport
Posted on by 56

Hi All,

 

I have an app that submits data to a SharePoint list with numerous columns. Due to the number of columns, I've created multiple screens that the user must complete before submitting the request.

Upon clicking the "New Request" button on the app's home screen, I'm setting a global variable as follows:

 

 

Set(glblRequestData, Defaults(My_SharePoint_List));

 

There are 3 screens in total:

 

  • Screen 1: formPart1, formAttachments
  • Screen 2: formPart2
  • Screen 3: formPart3

 

The "Item" property on formPart1, formAttachments, and formPart2 is set to the global variable, "glblRequestData".

formPart3 is essentially the "master" form which contains all of the fields to be submitted to the SharePoint list. The "Item" property on formPart3 is set as follows:

 

 

Patch(glblRequestData, formPart1.Updates, formPart2.Updates, formAttachments.Updates)

 

 

On Screen 3, there's another Attachments control included as one of the fields in formPart3. The Attachment controls on Screen 1  (formAttachments) and Screen 3 (formPart3) are associated to the same "Attachments" column on the data source (SharePoint List).

However, if I attach a file on Screen 1 (formAttachments) it's not carrying over to the attachments control on Screen 3 (formPart3). 

In other words, I add a file using the attachment control on Screen 1 (formAttachments), but then once I've proceeded onward to Screen 3, the Attachments control on that final screen shows "There is nothing attached" (as illustrated in the screenshot).

So, essentially I'm trying to figure out how to "link" these controls together in such a way that if the user attaches a file on Screen 1, that same file will be displayed in the Attachments control on Screen 3 prior to them submitting the request.

 

Any thoughts on what I may be doing wrong?

 

Thank you! 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,032 Most Valuable Professional on at

    Hi @bcanfield83 ,

    Why do you have the Item as a Patch? Why not simply run the Patch and then base Form3 on the resulting record. I think your problem lies here.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • Toastnbutter Profile Picture
    4 on at

    I am curious if you ever got this issue resolved?  If so, how?

  • bcanfield83 Profile Picture
    56 on at

    Hi @Toastnbutter - this is indeed working for me now, though it's been quite some time since I had initially run into this issue, so I don't entirely recall what I did to get it working other than

    a) deleting the form control that contains the Attachment Data Card/control altogether and then re-adding it.

    b) updating the OnStart property of the Power App itself to create an attachments collection:

     

        ClearCollect(
            colAttachments,
            Defaults(Requests).Attachments
        ),
     
    Requests  = the name of the SharePoint list which is the data source for the Power App submissions)
     

    My current design of the app/split form configuration is essentially the same as when I originally described it:

    • On the Main Menu (Start Screen) for the app, the user selects a "Request Type" from a Gallery Control. 
    • Upon selecting the Request Type, the user is navigated to screen1 of which the OnVisible property is set to: Set(varFormData, Defaults(Requests));
    • screen1 contains "Part 1" of the split form, formRequestPart1
    • Key Properties for formRequestPart1
      • DataSource: Requests
      • Item: varFormData
    • Within this form is the Attachment Data Card (DC_Attachments). This Data Card includes an Attachments control named attchAttachments. This should be added automatically by virtue of including the SharePoint Attachments column within your Form Control though obviously the name of the control will vary (I went with the highly creative "attchAttachments" 😉
    • Key Properties for the Attachments Data Card (DC_Attachments😞
      • DataField: {Attachments}
        • This is the standard/out of the box "Attachments" column which is added to all SharePoint lists. In other words, it's not a custom field/column that I needed to create.
      • Default: ThisItem.Attachments
      • Update: attchAttachments.Attachment
    • Key Properties for the Attachments Control (attchAttachments)
      • Items: colAttachments (this is the collection that's initially created via the app's OnStart property as alluded to above)
      • OnAddFile: ClearCollect(colAttachments, Self.Attachments)

    From here, the user would click on a button to proceed to the next screen. This contains the second (and final) portion of the split form (formRequestPart2). 

    • Key Properties for formRequestPart2:
      • DataSource: Requests
      • ItemPatch(varFormDataformRequestPart1.Updates)
    • I also have an Attachments Data Card on formRequestPart2 (DC_Attachments_2) which contains an Attachments Control (attchAttachments2) though the Data Card is not visible since the user would already be adding any attachments on the previous screen/form). I'm not sure this is necessary, but these are the key properties.DC_Attachments_2 Data Card:
      • Default: colAttachments
    • attchAttachments2 Control:
      • Items: colAttachments

     

    Now, within the OnSuccess property of formRequestPart2 is the functionality which sends an email notification. This includes a reference to the attachments. If a user adds 1 or more attachments to the "attchAttachments" control on the 1st screen:

     

    OnSuccess:

     

    Office365Outlook.SendEmailV2(

        "My_Email_Address@something.com”,

        "<My Email Subject>”,

        "<My Email Body>”,

        {

            Attachments: AddColumns(

                RenameColumns(

                    colAttachments,

                    "Value",

                    "ContentBytes"

                ),

                "@odata.type",

                ""

            ),

            Importance: "High"

        }

    );

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard