web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple conditions On...
Power Apps
Answered

Multiple conditions OnSuccess Form

(0) ShareShare
ReportReport
Posted on by 521

Hi 

I having trouble on this If condition on my form OnSuccess , all I need is for them to work their on so it doesn't tight each other example if I didn't enter Ticket comments still to perform other If statements regardless here is my formula at moment is not patching others if I don't enter comments, there must be a mistake somewhere  don't know where please help 

 

If(
 !IsBlank(txtCommentsTicket.Text),
 Patch(
 'TicketComments',
 Defaults('TicketComments'),
 {
 CommentID:Value( varRecordInspection.ID), 
 Comments: Text(txtCommentsTicket.Text),
 Employee: User().FullName,
 Title: Now(),
 ClCst: txtCstLabel.Selected.Value,
 InvoiceNumber: Text(txtInvoiceNumberTicket.Text)
 }
 ),
//,
If( 
 !IsBlank(PaidTextBoxTkt.Text) Or
 drpTrtkt.Selected.Value = "Closed",
 
 Patch(
 ChargePayment,
 Defaults(ChargePayment),
 {
 PaymentDate: Now(),
 
 
 Amount: Value(txttktAmount.Text),
 Payer: varUser.displayName,
 Title: Text(txtCommentsTicket.Text)
 
 }
 )

 ,



If(
 varItemtkt.DueDate <> dteDueDtetkt.SelectedDate && TiketInfoForm.Mode = FormMode.Edit,

Patch(
 'Tiket Audit Log',
 Defaults('Tiket Audit Log'),
 {
 Title: Now() & " - " & User().FullName ,
 Cst:varItemTiket.Name,
 TktID: varItemtkt.ID,
 ChangedDueDate: dteDueDtetkt.SelectedDate
 
 
 
 }
 ))

 

Thanks 

Categories:
I have the same question (0)
  • Verified answer
    PTBBSolutions Profile Picture
    691 on at

    Hi @PowerApps11 ,

     

    If I understood correctly you have to split your Ifs, otherwise it will always perform only 1 Patch action:

    If(
     !IsBlank(txtCommentsTicket.Text),
     Patch(
     'TicketComments',
     Defaults('TicketComments'),
     {
     CommentID:Value( varRecordInspection.ID), 
     Comments: Text(txtCommentsTicket.Text),
     Employee: User().FullName,
     Title: Now(),
     ClCst: txtCstLabel.Selected.Value,
     InvoiceNumber: Text(txtInvoiceNumberTicket.Text)
     }
     )
    );
    If( 
     !IsBlank(PaidTextBoxTkt.Text) Or
     drpTrtkt.Selected.Value = "Closed",
     
     Patch(
     ChargePayment,
     Defaults(ChargePayment),
     {
     PaymentDate: Now(),
     
     
     Amount: Value(txttktAmount.Text),
     Payer: varUser.displayName,
     Title: Text(txtCommentsTicket.Text)
     
     }
     )
    );
    If(
     varItemtkt.DueDate <> dteDueDtetkt.SelectedDate && TiketInfoForm.Mode = FormMode.Edit,
    
    Patch(
     'Tiket Audit Log',
     Defaults('Tiket Audit Log'),
     {
     Title: Now() & " - " & User().FullName ,
     Cst:varItemTiket.Name,
     TktID: varItemtkt.ID,
     ChangedDueDate: dteDueDtetkt.SelectedDate
     
     
     
     }
     )
    )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard