Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Patch function is not working after publishing the application

(1) ShareShare
ReportReport
Posted on by 12

Hi,

 

I've created an app and it's working fine but once I publish it the button for Patch function is not working!! Is there anything that I have to do to make the app working as it should be in the development stage?

 

You can find the code that I'm using for Submission.

 

Thank you all.  

  • kamel7777 Profile Picture
    12 on at
    Re: Patch function is not working after publishing the application

    I followed each line and indeed one of them was causing this issue which is this line : 

    'Order ID': gID.Text,

     I tried to make a variable for it to be like this : 

    Set(
     orderid,
     Text(
     Upper (
     Concatenate(
     Left(
     User().FullName,
     2
     ),
     "-",
     Text(
     varCurrentDateTime,
     "hhmmss"
     )
     )
     )
     )
    );

     

    Then I replaced the old line with this new formula:

    ForAll(
     galCart.AllItems,
     Patch(
     'Abudawood''s Cafe 1',
     Defaults('Abudawood''s Cafe 1'),
     {
     Quantity: Value(TextInput1.Text),
     Drinks: ThisRecord.Item.Title,
     'Office Number': dd3.Selected.Title,
     'Office Zone': dd4.Selected.Title,
     'User Name': usrNam.Text,
     'Order ID': orderid,
     'Date And Time ': Text(
     Now(),
     "mm/dd/yyyy hh:mm:ss"
     )
     
     }
     )
    );

     

    Now the patch is working, I don't know why it wasn't work earlier but now it's okay.

    Thank you.

  • fhamm Profile Picture
    on at
    Re: Patch function is not working after publishing the application

    When you click the patch button, is any data being patched back to your data source? If so, then the error might be in the later half of your code.

     

    If data isn't being patched at all, try commenting out one line of the Patch code at a time until the Patch works to find where the error lies. Maybe there is something wrong with the way one of the fields is written for your data source. If the Patch works with some of the fields commented out, then you'll know that there was something wrong with that line of code.

  • kamel7777 Profile Picture
    12 on at
    Re: Patch function is not working after publishing the application

    Hi @fhamm ,

     

    No there is no error message appears, It seems like nothing is happening and it should goes to another screen which contains the order reference after pressing the submit button. 

  • kamel7777 Profile Picture
    12 on at
    Re: Patch function is not working after publishing the application

    Hi @ANB ,

    there are no codes in the item property, Only to display the list content.

  • fhamm Profile Picture
    on at
    Re: Patch function is not working after publishing the application

    Is there a particular error message that is popping up when you try to push the button for the Patch function?

  • ANB Profile Picture
    7,075 Super User 2025 Season 1 on at
    Re: Patch function is not working after publishing the application

    @kamel7777 Can you confirm what is the Items property of your gallery? Is there any specific code on item property, if yes, please share that too.

     

    Thanks,

    ANB

  • kamel7777 Profile Picture
    12 on at
    Re: Patch function is not working after publishing the application

    I'm not using Dataverse at all , Only Sharepoint list.

     

    Answering your question that yes once I publish the application to try it before send it to other employees the patch button not working. 

  • kamel7777 Profile Picture
    12 on at
    Re: Patch function is not working after publishing the application
    //Patch all records to Abudawood's Cafe 1 List
    ForAll(
     galCart.AllItems,
     Patch(
     'Abudawood''s Cafe 1',
     Defaults('Abudawood''s Cafe 1'),
     {
     Quantity: Value(TextInput1.Text),
     Drinks: ThisRecord.Item.Title,
     'Office Number': dd3.Selected.Title,
     'Office Zone':dd4.Selected.Title,
     'Order ID': gID.Text,
     'User Name': usrNam.Text,
     'Date And Time ': Text( Now(), "mm/dd/yyyy hh:mm:ss" )
     //'Order Ref': Value(gID.Text)
     }
     )
    );
     
     
    //Patch all records to Orders Report List
    ForAll(
     galCart.AllItems,
     Patch(
     'Orders Report',
     Defaults('Orders Report'),
     {
     Quantity: Value(TextInput1.Text),
     Drinks: ThisRecord.Item.Title,
     'Office Number': dd3.Selected.Title,
     'Office Zone': dd4.Selected.Title,
     'Order ID': gID.Text,
     'User Name': usrNam.Text,
     'Date And Time ': Text( Now(), "mm/dd/yyyy hh:mm:ss" )
     }
     )
    );
     
    //Reset dropdown lists values
    Reset(dd3);
    Reset(dd4);
     
    //clear cart box
    Clear(colProductOrder);
     
    Navigate(
     ConfirmationScreen,
     ScreenTransition.Fade
    );
     
    //ID generator variable
    Set(varCurrentDateTime, Now());
  • powerJu Profile Picture
    34 on at
    Re: Patch function is not working after publishing the application

    You should double check your Patch function - If there is any error or required field set on Dataverse, you should include it on the patching.

    I dont know if I got it right. It was working and after publishing it stopped ?

  • ANB Profile Picture
    7,075 Super User 2025 Season 1 on at
    Re: Patch function is not working after publishing the application

    Hi @kamel7777 , I dont see any code.

     

    Thanks,

    ANB

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard