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 / patch record based on ...
Power Apps
Unanswered

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
    153,026 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
    153,026 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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard