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 / Function error after P...
Power Apps
Answered

Function error after Patch function

(0) ShareShare
ReportReport
Posted on by 85

Hi everyone,

 

I'm facing a stranged situation with patch function today.

It's very simple, I have a SAVE button with patch function to edit a field in my gallery linked to sharepoint list. For this it works fine, no problem.

The problem I have is that when I want to add another function after the patch function, like a Reset, or a Refresh (for the sharepoint list to show the updated field), or an Updatecontext it doesnt work.

I dont know why everything I put after the patch function is not accepted.

 

To be honest I'm almost an advanced user, I use very often 10-20 functions in a button for exemple. But Patch function is not a function I use very often, so I don't know why powerapps refuses every new function after the Patch.

 

My first patch function is a button to save modification in a gallery linked to a sharepoint list, after that I just want to update a variable to then disable the edit mode and come back to the view mode (its about button visible, displaymode, etc...) of the list, very simple normaly :

1b.jpg

 

Patch('HRS Teams Naming Convention'; ThisItem; {Code:TextInput2.Text;Description:TextInput3.Text;'Code Type':Dropdown1.Selected.Value});UpdateContext({codes_dmb2:false;codes_dmb:true})

 

 

As you can see if I separate my functions with a ; everything after is not recognized and I receive an error saying "Unexpected characters, some characters used in this formula are unexpected).

Normally I use a "AND" or a "&" to separate formulas, but I saw ";" on youtube with PowerApps 911 channels which is very pro. 

 

If I use AND or &, like I do for everywhere else, then the code is recognized, I have no error, but then the button doesnt work, it does nothing...

 

Thanks for your help, I'm trying to fix this since hours....

 

Any Idea ?

 

 

 

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

    Hi @Nours74 ,

    Only one small change required

    Patch(
     'HRS Teams Naming Convention'; 
     Thisltem; 
     {
     Code:Textlnput2.Text;
     Description:Textlnput3.Text;
     'Code Type':Dropdownl.Selected.Value
     }
    );;
    UpdateContext(
     {
     codes_dmb2:false;
     codes_dmb:true
     }
    )

     

    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.

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @ Nours74:

    Firstly, thanks for @WarrenBelz s solution.

    Have you tried this code?

    Patch('HRS Teams Naming Convention'; ThisItem; {Code:TextInput2.Text;Description:TextInput3.Text;'Code Type':Dropdown1.Selected.Value});;UpdateContext({codes_dmb2:false;codes_dmb:true})
    /*Just replace the “;” with “;;”*/

    Has your problem been solved?

    Secondly, I think you may be confused about why you cannot use ; to separate these two formulas.

    The reason is language dependent. In some specific region, ; represent ,, ;;, represent ;.

    I think this link will help you a lot:
    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/global-apps

    Best Regards

    Bof

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard