cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nours74
Helper II
Helper II

Problem after Patch function

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, 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 kinda 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, it looks like a syntax error but I cant explain why. If I just add a space after the patch function the editor suggest to add IN or EXACT IN only, like I was still in the patch function, but I'm sure at 100% the function is good, it works alone without any problem.

 

So I have button to save modifications 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 buttons visible, displaymode, etc...):

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 my formulas, but I saw ";" on a youtube video from PowerApps 911 specially for Patch function, he used a UpdateContext after the patch function, using ; to separate formulas, and for him it worked fine, but not for me...

 

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 ?

2 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User III
Super User III

@Nours74 

You will need to use a double ;; to indicate a line-break.

 

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

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

eka24
Super User III
Super User III

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

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

3 REPLIES 3
mdevaney
Super User III
Super User III

@Nours74 

You will need to use a double ;; to indicate a line-break.

 

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

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

eka24
Super User III
Super User III

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

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Nours74
Helper II
Helper II

Thank you so much for the help, youtube and microsoft Docs never told me about that.

 

Thanks and good day !

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (18,435)