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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,237)