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 / Power Apps / Want to have two attac...
Power Apps
Unanswered

Want to have two attachment fields in Canvas power app - Sharepoint list the data source

(0) ShareShare
ReportReport
Posted on by

Hello All,

I am creating canvas power app for one of my application. it uses the data source as SharePoint list. I have created a NewScreen with Form1. As sharepoint list only have one attachment field.

But I want to have two attachment fields to make user attach for two different sections like in tab A and in Tab B. I can able to make this field enable in TAb A with one default attachment field but not in TAb B. Means if user attaches in  tab A should not show those attachments in tab B. that's why I need to have two attachments fields.

 

Powerapp_Q1.png

 

 

Is there any way to achieve this?

 

Is there any other solution to achieve this?

 

Appreciate your help

 

Many Thanks,

Saanv

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Saan 

     

    If you want to configure this, you might need to add two separate edit forms and set the Mode to New. The visibility of these forms will be set according to the tabs/screens visibility.

    Now, you might need to add the attachments using the Patch function as:

    Assuming that you created Form1 and Form2 associated to the same datasource and added only attachment datacards.

    Button to Submit -> OnSelect -> Patch(DataSourceName, Defaults(DataSourceName),{Name:TextInput1.Text},Form1.Updates,Form2.Updates)

    This will it will attach both the attachments to the same item. This is a sample expression which can be modified according to the app setup.

    If this differs, please share more details about this so that we might be able to help you better.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    I'm just wondering if isn't a good idea to use an additional list in Sharepoint linked to first list by ID in which you can keep the attachments from the second field. 

    Also in app you'll have two forms updated/showed simultaneously.

     

  • Saan Profile Picture
    on at

    Hello @yashag2255 ,

     

    Am not sure whether I understand correctly, I recently updated the post with the screenshot for better understanding. is that helps? Could you explain me in some screenshots. above I made some 6 tabs by defining a Variable to a button and enable fields depending on variable(Button click).

     

    Please let me know if you need any more information.

     

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Saan 

     

    As you are using single form and setting the visibility of fields based on selection, there is no way to directly add the option for attachments in two separate places.

    Instead of setting up the fields visibility, can you create separate edit forms for all the tabs and set their visibility based on what you are doing for the individual data cards.

    Now you will have different forms, so they all cannot be submitted as once using the SubmitForm() expression on the Submit button, for this you need to use Patch expression as:

    Patch(DataSourceName, Defaults(DataSourceName),Form1.Updates,Form2.Updates,Form3.Updates,Form4.Updates,Form5.Updates,Form6.Updates)

     

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @Saan ,

     

    Did you mean that you want to separate this one attachments fields to 2 data cards inside the form control, but still update all attachments to this single attachments field? Please understand that you cannot create or add columns to SP list within PowerApps.

     

    Regards,

    Mona

  • Saan Profile Picture
    on at

    Hello @v-monli-msft 

     

    Yeah I want to have two data cards in single form but that should update back to sharepoint attachment field once hit submit form.

     Is there any possibility of this?

    or any other solution for this?

     

    Thanks,

    Saanv

  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    I don't think this is supported. Others have suggested using patch:

     

    patch(form1.updates, form2.updates, etc)

     

    However, the above processes the multiple forms in order. If two forms have the same field, the form that is last in the patch expression will overwrite any other values. This means that if there is an attachment in both form1 and form2, only the value from form 2 will be kept. (if there is only an attachment in form1, and the attachment is left blank in form2, then the attachment will be submitted as blank).

     

    The solution I've used in the past is to have a screen for attachments, and buttons on the other forms as needed to navigate to this form. This is not optimal for the users, but it does allow multiple attachments from multiple places in the app, sort of.

  • KyleJ Profile Picture
    91 on at
    Title:TextInput.Text, },Form1.Updates)); Concurrent( Patch(Datasource,LookUp(Datasource,ID=PrevPatchedID.ID),Form1_1.Updates), Patch(Datasource,LookUp(Datasource,ID=PrevPatchedID.ID),Form1_2.Updates) )

     

    @Mike2500 
    I have a solution.


    When you patch an item, you are able to save the patch to a variable, giving you the newly created ID number. From there, you can patch updates to that same record via ID. 

    We know, you can

    Patch(YourDatabase,Defaults(YourDatabase),{Field:"Value"},form1.Updates)

    But lets expand on this. In ONE SINGLE submission, we need to accomplish a few things. You can first submit the record as above, with 1 of your attachments being submitted. But, lets go ahead and grab the newly created ID by wrapping a Set Variable around the Patch Function. 

    Set(PatchedID,Patch(YourDatabase,Defaults(YourDatabase),{Field:"Value"},form1.Updates))

    The above code will now submit the record and all fields, and it will add the first attachment, and return to the variable the ID (among other info) 

    We can now execute, two additional patch functions. 

    Patch(YourDatabase,LookUp(YourDatabase,ID=PatchedID.ID),Form1_1.Updates);
    Patch(YourDatabase,LookUp(YourDatabase,ID=PrevPatchedID.ID),Form1_2.Updates);

    All together, these three functions (the first being the "Set(Patch())" ) all together will submit multiple attachments from multiple sections of 1 singular form, into 1 single record. 
    Finished code should look about like this: 

     

     

    Set(PrevPatchedID,Patch(Datasource,Defaults(Datasource),{
                          

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 > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard