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 record based on ...
Power Apps
Answered

patch record based on condition in powerapps

(0) ShareShare
ReportReport
Posted on by 227

Hi,

 

My Datasource is Excel,which contains columns "Ref No","Cancel Reservation","Cancel Reason","Current Status" & "Steps". I have Gallery on my Screen,which contains "Ref No" and other information. When User Clicks on their desired "Ref No", it navigates them to the form (Edit Mode), which consists of "Cancel Reservation","Cancel Reason","Current Status" & "Steps". I used visible property of the datacard such that when User Selects "Y" from "Cancel Reservation" datacard it display them "Cancel Reason" and "Current Status" datacard. When User Selects "N", it displays them "Current Status" and "Steps" datacard. I would like to patch my form based on User selection. Ex. If User selects "Y" under Cancel Reservation, then the data that need to be patch are for columns "Cancel Reason" and "Current Status". If User selects "N", then "Current Status" and "Steps" column should be patch to the Excel. I am not sure if something like this is possible ?

 

The "OnSelect" of  Submit button is set to Submitform(form1).

 

Thanks in advance for your time!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @Newbie12 ,

    One question first - why are you needing to do this when SubmitForm() will send the required data -it there is nothing in the other fields, then nothing will be updated in them (the visibility of a card does not affect its operation in Update).
    You can certainly do a conditional Patch based on the selection.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Newbie12 Profile Picture
    227 on at

    Hi @WarrenBelz ,

     

    Whenever, I select "N" under Cancel Reservation, and add data to Current Status and Steps columns. It also add data from "Cancel Reason" column. "Cancel Reason" contains dropdown items such as "System Issue","Connectivity Issue","Other" etc.

  • Verified answer
    WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @Newbie12 ,

    There are other workarounds for this including conditional Update properties on Cards and using Combo boxes, which do not have a value in them unless you select it, however going with the Patch (and Excel causes some limitations here), if you put a button in a Custom Card on the form, you would do something like this OnSelect

    If(
     YourCancelReservationDD.Selected.Value="Y",
     Patch(
     YourTableName,
     ThisItem,
     {
     'Cancel Reason':YourCancelReasonBox.Text,
     'Current Status':YourCurrentStatusBox.Text
     }
     ),
     Patch(
     YourTableName,
     ThisItem,
     {
     'Steps':YourStepsBox.Text,
     'Current Status':YourCurrentStatusBox.Text
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Newbie12 Profile Picture
    227 on at

    @WarrenBelz. Thank you!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard