cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

The case of Shrodinger's TextInput Reset

Hi all, 

I'm new-ish to PowerApps and have finally found (my first) canvas build issue the internet hasn't answered for me. Any guidance is appreciated.  TL:DR at the end.

 

Background:

I have a SP List (Link list) with two lookup columns that pull from two other SP lists (Site list and Study list). I've inserted an Edit Form in PowerApps that connects to the Link list where I can create new records from the Site and Study lists and they populate the Link list nicely. However, because the Link list only contains two original lookup columns, I had trouble pulling the associated data into PA through my selections from the Link list in the related lookup fields in the Site and Study lists through the form. Because I wanted to see some information associated with the Site and Study selections I made from the Link list in PA, I added two TextInput fields with If and Lookup functions. 

 

When I select an option from the Link list, the TextInput fields look up related data from the Site or Study list to return associated data to the selection, strictly for information - these TextInput fields aren't patching anywhere. The If function looks at the !IsBlank status of the form drop down selection and returns the lookup data as true. I have tried several options for the else part of the formula to indicate returning the field to blank if the dropdown is blank/reset, but none have worked so far. 

 

 I have two buttons on this screen. One to Submit and reset the form, which also emails entries on the screen, and *is supposed to* reset the TextInput fields. The second button is strictly for resetting all fields/variables on the screen - but it doesn't, sometimes.  

The Submit button has a conditional DisplayMode where it is disabled unless both TextInput fields are not blank (because it was easier to set that condition than setting it on the dropdown selections). 

 

ReCap:

3 SP lists - Link list lookups up data from Site list and Study list

1 form - two dropdown selections, one looksup from Site list and one looksup from Study list and submission adds a new record of the combination to the Link list

1 Submit Button - Supposed to: Submit form, reset/new form, email entry info, reset textinput fields

1 Reset Button - Supposed to: Reset all variables on the screen

 

Shrodinger's Reset problem:

In Preview, if I make selections in the form fields, the textinput fields populate with the correct information and if I hit the Reset button, all fields clear, like they're supposed to. 

If I make form selections and I hit the Submit button, the form submits, the email sends, but the textinput fields do not reset. Hitting the Reset button after submitting the form does not clear/reset the text input fields either and the Submit button does not disable because the textinput fields continue to contain entries even though the drop downs are blank/reset. 

After hitting Submit, the only way to clear one of the textinput fields is to make a new selection in the form dropdown which makes one textinput active and the other empty. This also disables the Submit button. 

 

Things I've tried:

 - On the textInput fields entering ResetButton.Pressed and SubmitButton.Pressed in the Reset property

 - In OnSelect in both the Submit and Reset buttons entering Reset(Studytextinput) ;/&& Reset(Sitetextinput)

 - Adding the If function to the text inputs to set the else to "" or equal to the dropdown selection or Blank()

 - In OnSelect in the buttons Set(Sitetextinput, Blank()) and Set(Studytextinput, Blank())

 - In OnSelect of Submit button ResetForm(Form) (because this is the only reset command I have in the Reset button right now and it works to clear the text fields BEFORE the form is submitted, but not after)

 

I have other screens where the resets work fine and I can't figure out why the same processes aren't applying here. What am I missing? 

 

TL:DR:

If I submit my form, the textinput fields won't reset. If I reset the fields before the form is submitted, the reset button works fine. A reset function for the textinput fields is included in the Submit button, but it doesn't work either. 

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

Hi @PowerRanger , Thank you for this suggestion. I will try putting the extra commands in OnSuccess in the future. Thank you for your help with this issue!

 

In the interim, I identified it's something to do with the email, and I haven't figured it out what, but I've found a workaround (below). 

 

I built a new screen, with a new form, new text input and label fields (testing both types) and new buttons. I tested the submission and resets along the way, and they all worked like they were supposed to - until I added the email function! I didn't include the body of this in my last message either because I though it immaterial, but something in the email command during submit is hanging up the textinput fields. 

 

The email body would report the entries in each field, both for the form and the textinputs, but when the form would reset after emailing, the text input fields would not. 

 

I then re-arranged the commands in my submit button and set the email to send after the form is submitted and reset. This would then return an email with the textinput fields data and reset the fields, but the email would not include the data selections from the form (makes sense). The form was submitting correctly the entire time. 

 

My workaround:

1. Removing the If(!IsBlank commands from the textinput fields.

2. Added two more textinput fields to lookup the same items selected in the form fields. 

3. Switched out the reporting the form field selections in email to the added textinput fields instead.

 

Result: The email reports on the textinput fields which relay all of the required information, the form resets, and when the form resets the lookup textinput fields reset too. 

 

SubmitForm(AssignForm);
NewForm(AssignForm);

Office365Outlook.SendEmailV2("email@email.com", "New Assignment",

"Study ID: "&TextInput4.Text &
"<br> Study Name : "&TextInput2.Text&
"<br> Site Number: "&TextInput5.Text &
"<br> Site Name: "&TextInput3.Text,

{Importance: If(AssignTog.Value = true, "High", "Normal")} );

 

Reset(AssignTog)

View solution in original post

@Anonymous in the OnSuccess you still have access to those values. You could use FormName.LastSubmit which will return a record with all values submitted to the datasource. It would for example also contain the SharePoint ID for a newly created item. That's why you should always use the OnSuccess Property of an Form if you have subsequent commands. First of all you can be sure that your logic will run only if the Submit was successfull and second you get additional information from the datasource 😉

 

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.




​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.

View solution in original post

10 REPLIES 10

@Anonymous so what Formular do you have set for Default Property of the Text fields? 




​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.
Anonymous
Not applicable

Right now the Default properties on the text fields are If + Lookup like:

 

If(!IsBlank(DataCardValue118), Lookup(Studylist, Title = DataCardValue118.Selected.Value, StudyName)) 

 

I've tried adding Blank(), " ", and DataCardValue118, to the else section, but none of these have resulted in the textfields reseting/blanking when the dropdown (DCV118) is reset.  It works perfectly for returning the correct record based on the dropdown selection though. 

@Anonymous try this. You have just checked the control and this will never be blank.

 

If(!IsBlank(DataCardValue118.Selected), Lookup(Studylist, Title = DataCardValue118.Selected.Value, StudyName))

 

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.




​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.
Anonymous
Not applicable

Thanks, but that didn't change anything. 

 

I have Reset commands included on the Submit button and they did not reset the text fields when I hit the submit button. I could not reset the text fields manually using the reset button after submission either (as previously reported). 

 

Any other suggestions? 

@Anonymous does the dropdown (Lookup columns) have any Default Selected Items? What Formular do you use for resetting the Form? 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.




​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.

@Anonymous Just double checked the formular and there was a mistake. You should have seen a Error actually.

So on the TextInput Default Property use:

 

 

If(
    !IsBlank(DataCardValue118.Selected),
    LookUp(
        Studylist,
        Title = DataCardValue118.Selected.Value
    ).StudyName
)

 

 

This will clear the Textfield as soon as there is no selection made on the ComboBox.

 

To Reset the Form use:

 

ResetForm(yourFormName)

 

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.




​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.
Anonymous
Not applicable

Hi @PowerRanger 

 

Thanks for the suggestions, but updating the comma to a period did not change the result either. The form still does not clear when I hit the submit button and will not clear if I hit the Reset button after submitting. 

 

The lookup columns do not have any defaults other than being required fields. The form resets each time i hit the submit button. It's only the textinput fields that do not reset upon submit. 

 

My Submit button has several commands: 

 

SubmitForm(AssignForm);

Office365Outlook.SendEmailV2("email@email.com", "New Asignment",

<I've deleted the body of my email for this example>;
ResetForm(AssignForm);
Reset(StudyTextInput);
Reset(SiteTextInput);
NewForm(AssignForm)

@Anonymous on your submit button please use only

SubmitForm(AssignForm);

 

All other Formulars should be placed in the OnSuccess Property of your Form. They will be triggered as soon as the Submit was successfull. If this will change the behavior I can't tell but it is definitely the correct way.

 

Please let me know if this then has a positive effect on your issue. 

 

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.




​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.
Anonymous
Not applicable

Hi @PowerRanger , Thank you for this suggestion. I will try putting the extra commands in OnSuccess in the future. Thank you for your help with this issue!

 

In the interim, I identified it's something to do with the email, and I haven't figured it out what, but I've found a workaround (below). 

 

I built a new screen, with a new form, new text input and label fields (testing both types) and new buttons. I tested the submission and resets along the way, and they all worked like they were supposed to - until I added the email function! I didn't include the body of this in my last message either because I though it immaterial, but something in the email command during submit is hanging up the textinput fields. 

 

The email body would report the entries in each field, both for the form and the textinputs, but when the form would reset after emailing, the text input fields would not. 

 

I then re-arranged the commands in my submit button and set the email to send after the form is submitted and reset. This would then return an email with the textinput fields data and reset the fields, but the email would not include the data selections from the form (makes sense). The form was submitting correctly the entire time. 

 

My workaround:

1. Removing the If(!IsBlank commands from the textinput fields.

2. Added two more textinput fields to lookup the same items selected in the form fields. 

3. Switched out the reporting the form field selections in email to the added textinput fields instead.

 

Result: The email reports on the textinput fields which relay all of the required information, the form resets, and when the form resets the lookup textinput fields reset too. 

 

SubmitForm(AssignForm);
NewForm(AssignForm);

Office365Outlook.SendEmailV2("email@email.com", "New Assignment",

"Study ID: "&TextInput4.Text &
"<br> Study Name : "&TextInput2.Text&
"<br> Site Number: "&TextInput5.Text &
"<br> Site Name: "&TextInput3.Text,

{Importance: If(AssignTog.Value = true, "High", "Normal")} );

 

Reset(AssignTog)

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,113)