cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Silva_BR
Helper III
Helper III

Cannot work variable inside a form

Hi guys!

I'm going through something unusual for me.I'm doing a Tabbed Forms in my application and I need that at the end of each session click on the "confirm" button to go to the next session that hides and excuses my form. I then put this button and in the OnSelect property I put the formula

UpdateContext({varCheckout: varCheckout+1})

But the problem is that my variable is not incremented... if I copy and paste this same button out of my form it works and increments the variable as needed. I tried both with Set() and UpdateContext() both didn't work inside the form just outside the form.

Ty for all!

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Silva_BR ,

Please have a look at this post - I will include your thread on it, however I cannot duplicate that here (the button inside a card on a form works as expected). What Mode is your form in?

View solution in original post

Hi @Fonyx ,

New Mode is only good for creating new records and this function has to be available (as it always has before) for Edit and View modes - this bug seems to be inconsistent (at least it does not happen in all cases) as I have only managed to duplicate it once.

View solution in original post

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @Silva_BR ,

Please have a look at this post - I will include your thread on it, however I cannot duplicate that here (the button inside a card on a form works as expected). What Mode is your form in?

Fonyx
Frequent Visitor

Hi @Silva_BR ,

We have been battling with this kind of problem for a little while now. See @WarrenBelz Reply above and links provided. My first suggestion is to check the formMode for each of your partial forms. My needs required them to be set to New mode to get form control details out into context so try that. Make sure when you find the mode that works you go and set it for all your partial form components so you don't forget and have to remember later. A word though, there is definitely a bug in here that @WarrenBelz Knows more about and microsoft is working on but hopefully this can help.

Hi @Fonyx ,

New Mode is only good for creating new records and this function has to be available (as it always has before) for Edit and View modes - this bug seems to be inconsistent (at least it does not happen in all cases) as I have only managed to duplicate it once.

Thanks a lot, so this would be a bug? I'll post a gif to better exemplify what's happening to me. @WarrenBelz / @Fonyx  I saw the post you indicated but the problem seems to be different, can you analyze it with this gif available?

Silva_BR
Helper III
Helper III

My form was not in the edit module for the new module and it worked, changed. Thank you very much

Jonathan_Ross90
Regular Visitor

I just wanted to comment to thank @WarrenBelz - I was stuck on this problem for hours, scouring multiple threads to no avail, until I saw your comment about the FormMode. Having it set to Edit is what did me in - now that I changed FormMode to New, I'm back in business. Thank you!!

Fonyx
Frequent Visitor

Hey @Silva_BR , Yes this is the issue with scoped state we are talking about. It seems that passing state out of the form when it is in edit mode is the bug. If the form is in new mode this will work I think, but right now, having a current item in the form and the mode set to edit won't allow you to extract the form field values and put them into context or global variables. Please anyone correct me if I'm wrong here. @WarrenBelz 

Hi @Fonyx ,

I think you are correct from the posts I have seen - as this is a bug however it obviously not what should be the case.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,391)