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 / patch dropdown to shar...
Power Apps
Answered

patch dropdown to sharepoint list

(0) ShareShare
ReportReport
Posted on by 418

Hi, wanna ask what is the valid patch function for dropdown/choice? I have tried with no error but data not save in my sharepoint list.

 

I have 2 dropdown menu with single selection which is tax & currency.. all record succesfully save in sharepointlist after submit except tax & currency which is datatype is Choice.

 

twister_0-1618543841477.png

 

Clear Collect:

 

ClearCollect(
 colApp,
 {
 invoiceno: "",
 invoicedate: Blank(),
 invoiceamount: 0,
 paymentref: "",
 paymentdate: Blank(),
 paymentamount: 0,
 days: 0,
 percentsales: 0,
 amountsales: 0,
 tax: "6",
 currency: "AUD",
 ShowSaveButton: true
 }
),

 

 

Patch to collection:

 

Patch(
 colApp,
 ThisItem,
 {
 invoiceno: TextInput1.Text,
 invoicedate: DatePicker1.SelectedDate,
 invoiceamount: Value(TextInput2.Text),
 paymentref: TextInput6.Text,
 paymentdate: DatePicker2.SelectedDate,
 paymentamount: Value(TextInput7.Text),
 days: Value(TextInput24.Text),
 percentsales: Value(TextInput23.Text),
 amountsales: Value(TextInput25.Text),
 tax: Dropdown1.Selected.Value,
 currency: Dropdown3.Selected.Value,
 ShowSaveButton: false
 }
);
If(
 EditPressed,
 false,
 Collect(
 colApp,
 {
 invoiceno: "",
 invoicedate: Blank(),
 invoiceamount: 0,
 paymentref: "",
 paymentdate: Blank(),
 paymentamount: 0,
 days: 0,
 percentsales: 0,
 amountsales: 0,
 tax: "6",
 currency: "AUD",
 ShowSaveButton: true
 }
 )
);

 

 

Final patch onSuccess form:

 

If(
 CountRows(colApp) > 0,
 ForAll(
 colApp,
 If(
 !IsBlank(invoiceno),
 Patch(
 sinc_main_payment,
 Defaults(sinc_main_payment),
 {
 Title: Form1.LastSubmit.ID,
 app_no: Form1.LastSubmit.Title,
 invoice_no: Upper(invoiceno),
 invoice_date: DateValue(invoicedate),
 invoice_amount: invoiceamount,
 payment_ref: Upper(paymentref),
 payment_date: DateValue(paymentdate),
 payment_amount: paymentamount,
 days: days,
 percent_sales: percentsales,
 tax: Dropdown1.Selected,
 currency: Dropdown3.Selected,
 amount_sales: amountsales
 }
 )
 )
 )
);

 

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @twister ,

     

    The value of the Choice column is a record. The record has only one column. The column name is 'Value'.

    So you could try this: 

    tax: {Value:Dropdown1.Selected.Value} 

    instead of 

    tax: Dropdown1.Selected

     

    and use 

    currency: {Value:Dropdown3.Selected.Value}

    instead of 

    currency: Dropdown3.Selected

     

    In addition , If it still doesn't work, please provide the formula of two dropdown controls' Items property.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

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

    Hi @twister ,

     

    Are your two dropdown controls in your form/datacard?

     

    If so, this may be because after you use the submitform function, the value of the dropdown control is automatically cleared, causing you to use the patch function to provide a null value.

     

    So, you could create 2 variables to save the value of your 2 dropdown controls.

     

    Please try this formula when you use SubmitForm() function:

    Set(Thevar1,Dropdown1.Selected);Set(Thevar2,Dropdown3.Selected);SubmitForm(your form)

     

    If(
     CountRows(colApp) > 0,
     ForAll(
     colApp,
     If(
     !IsBlank(invoiceno),
     Patch(
     sinc_main_payment,
     Defaults(sinc_main_payment),
     {
     Title: Form1.LastSubmit.ID,
     app_no: Form1.LastSubmit.Title,
     invoice_no: Upper(invoiceno),
     invoice_date: DateValue(invoicedate),
     invoice_amount: invoiceamount,
     payment_ref: Upper(paymentref),
     payment_date: DateValue(paymentdate),
     payment_amount: paymentamount,
     days: days,
     percent_sales: percentsales,
     tax: Thevar1,
     currency: Thevar3,
     amount_sales: amountsales
     }
     )
     )
     )
    );

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • twister Profile Picture
    418 on at

    yes.. my form have 1 combobox(multiple selection).. I have try both of your suggestion formula seems not worked to me.. its same..tax & currency not save in sharepoint list

     

    twister_0-1618557290984.png

     

    Tax items property:

    twister_1-1618557447752.png

     

    Curreny items property:

    twister_2-1618557483826.png

     

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

    Hi @twister ,

     

    Please provide the following formula:

    1\ the formula of two dropdown controls' Items property

    2\ The complete formula using the submitform function

    3\ Formula of onsuccess property

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • twister Profile Picture
    418 on at

    Tax items property:

    twister_0-1618557630131.png

     

     

    Curreny items property:

    twister_1-1618557630027.png

     

    Submit button:

    twister_2-1618557767808.png

     

    OnSuccess:

    If(
     CountRows(colApp) > 0,
     ForAll(
     colApp,
     If(
     !IsBlank(invoiceno),
     Patch(
     sinc_main_payment,
     Defaults(sinc_main_payment),
     {
     Title: Form1.LastSubmit.ID,
     app_no: Form1.LastSubmit.Title,
     invoice_no: Upper(invoiceno),
     invoice_date: DateValue(invoicedate),
     invoice_amount: invoiceamount,
     payment_ref: Upper(paymentref),
     payment_date: DateValue(paymentdate),
     payment_amount: paymentamount,
     days: days,
     percent_sales: percentsales,
     tax: {Value: Dropdown1.Selected.Value},
     currency: {Value: Dropdown3.Selected.Value},
     amount_sales: amountsales
     }
     )
     )
     )
    );
    Clear(colApp);
    
    Refresh(sinc_main_payment);
    
    Set(
     varLoad,
     false
    );
    Notify(
     "Success",
     NotificationType.Success
    );
    Navigate(SuccessPage);
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @twister ,

     

    Have you tried this?

    1\ use this formula on Submit button:

    Set(Thevar1,Dropdown1.Selected.Value);Set(Thevar2,Dropdown3.Selected.Value);SubmitForm(Form1);Set(varLoad,true)

     

    2\ OnSuccess:

     

    If(
     CountRows(colApp) > 0,
     ForAll(
     colApp,
     If(
     !IsBlank(invoiceno),
     Patch(
     sinc_main_payment,
     Defaults(sinc_main_payment),
     {
     Title: Form1.LastSubmit.ID,
     app_no: Form1.LastSubmit.Title,
     invoice_no: Upper(invoiceno),
     invoice_date: DateValue(invoicedate),
     invoice_amount: invoiceamount,
     payment_ref: Upper(paymentref),
     payment_date: DateValue(paymentdate),
     payment_amount: paymentamount,
     days: days,
     percent_sales: percentsales,
     tax: {Value: Thevar1},
     currency: {Value: Thevar2},
     amount_sales: amountsales
     }
     )
     )
     )
    );
    Clear(colApp);
    
    Refresh(sinc_main_payment);
    
    Set(
     varLoad,
     false
    );
    Notify(
     "Success",
     NotificationType.Success
    );
    Navigate(SuccessPage);
  • twister Profile Picture
    418 on at

    Got error when im using function value

    twister_0-1618559088514.png

     

    If no value

    twister_1-1618559104925.png

     

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

    Hi @twister ,

     

    What's the error message?

     

    Best Regards,
    Wearsky

  • twister Profile Picture
    418 on at

    This error I guess..

     

    twister_2-1618559392816.png

     

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

    Hi @twister ,

     

    So, what's 'Drop1' and 'Drop3'? Could you provide their formula?

     

    Best Regards,
    Wearsky

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 414

#2
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard