cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Saan
Level: Powered On

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

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

7 REPLIES 7
Dual Super User
Dual Super User

Re: Want to have two attachment fields in Canvas power app

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!

gabibalaban
Level 8

Re: Want to have two attachment fields in Canvas power app

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
Level: Powered On

Re: Want to have two attachment fields in Canvas power app

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.

 

 

Dual Super User
Dual Super User

Re: Want to have two attachment fields in Canvas power app

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!

Community Support Team
Community Support Team

Re: Want to have two attachment fields in Canvas power app

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

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Saan
Level: Powered On

Re: Want to have two attachment fields in Canvas power app

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
Level 8

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

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.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,789)