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 / 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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard