cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnPhamEFL
Advocate I
Advocate I

Patch attachment with datacard & list box value

Hi Expert,

 

Im trying to create a Custom form from SP list using powerapps. I'm having cascading dropdown, listbox & Data card. I'm stucking after a few hours searching online about patching attachment to my SP List.

 

Here is the code of my submit button, it will create 2 row like attachment.

 

Set(
    currentRecord,
    Patch(
        Data,
        Defaults(Data),
        {
            Department: DataCardValue8.Selected.Result,
            Team: DataCardValue6.Selected.Result,
            FullName: Concat(
                ListBox1.SelectedItems,
                'Full Name' & ","
            ),
            Category: {
                Value: DataCardValue3.Selected.Value,
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
            }
        }
    )
);
SubmitForm(SharePointForm1);
NewForm(SharePointForm1)//;Navigate(Screen1,ScreenTransition.Fade)

 

Any help pleaseee 😞 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AnPhamEFL 

Then you don't have the Update properties set right on the Datacards that contain them.

Based on your patch formula, the Update properties of the datacards should be as follows:

For Department datacard:   DataCardValue8.Selected.Result

For Team datacard: DataCardValue6.Selected.Result

For FullName datacard: Concat(ListBox1.SelectedItems, 'Full Name' & ",")

For Category datacard: {Value:DataCardValue3.Selected.Value}

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@AnPhamEFL 

Why are you patching things from your Form?

The only function you need to submit your form is SubmitForm.

 

This is also the only mechanism to submit attachments.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi Randy,

I'm already try SubmitForm but it does not input my others DataCard & multiple choices in ListBox.

RandyHayes
Super User
Super User

@AnPhamEFL 

Then you don't have the Update properties set right on the Datacards that contain them.

Based on your patch formula, the Update properties of the datacards should be as follows:

For Department datacard:   DataCardValue8.Selected.Result

For Team datacard: DataCardValue6.Selected.Result

For FullName datacard: Concat(ListBox1.SelectedItems, 'Full Name' & ",")

For Category datacard: {Value:DataCardValue3.Selected.Value}

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes Thank you so much !!! you save my day.

RandyHayes
Super User
Super User

@AnPhamEFL 

No problem!  Yes, in general, stay away from Patches when you are using a Form...it will do everything for you.  

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,977)