web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Resetting a Text input...
Power Apps
Answered

Resetting a Text input box breaking my flow

(0) ShareShare
ReportReport
Posted on by 9

Hi, I am trying to build an app that allows a user to input text into 7 text boxes, then use that information to populate an email and send it to a shared inbox when a "Submit" button is clicked. I have set up my flow and it is working correctly. My button has the following code on the OnSelect.

 

SendEmailCoverRequests.Run(
    TextInput_Name.Text,
    TextInput_Date.Text,
    TextInput_Reason.Text,
    TextInput_Details.Text,
    TextInput_Where.Text,
    If(
        IsBlank(TextInput_LessenCover),
        "",
        TextInput_LessenCover.Text
    ),
    If(
        IsBlank(TextInput_Duties),
        "",
        TextInput_Duties.Text
    )
);
Notify("Your request has been sent.");

Reset(TextInput_Name);
Reset(TextInput_Date);
Reset(TextInput_Reason);
Reset(TextInput_Details);
Reset(TextInput_Where);
Reset(TextInput_LessenCover);
Reset(TextInput_Duties);
 
The intention is to have the first 5 text boxes be required and the last two be optional. This works fine when all text boxes are filled and it works when one or more of the optional text boxes are blank. However when I use the Reset() function to reset the optional fields (TextInput_LessenCover and TextInput_Duties in this case), and the optional fields are left blank, the flow is unable to send the emails as it is sending a blank value for the 6th and 7th text boxes instead of "". 
 
Is there another function I can use instead of Reset() to stop my app only working once before needing to be reloaded?
Categories:
  • TuongDoan Profile Picture
    573 Moderator on at

    Your code looks fine LOL

  • Verified answer
    Gelmarus Profile Picture
    9 on at

    Managed to find a fix for my problem. I think the issue was the If statement was setting my TextInput_Lessen and TextInput_Duties to a value once, then not doing it again. I fixed this by making the default value of the text boxes a variable and setting that to "" when I reset the text. Default value of the the text input box is VarLessen and VarDuties respectfully. 

     

    SendEmailCoverRequests.Run(
        TextInput_Name.Text,
        TextInput_Date.Text,
        TextInput_Reason.Text,
        TextInput_Details.Text,
        TextInput_Where.Text,
        If(
            IsBlankOrError(TextInput_LessenCover),
            "",
            TextInput_LessenCover.Text
        ),
        If(
            IsBlankOrError(TextInput_Duties),
            "",
            TextInput_Duties.Text
         )
    );
    Notify("Your request has been sent.");

    Reset(TextInput_Name);
    Reset(TextInput_Date);
    Reset(TextInput_Reason);
    Reset(TextInput_Details);
    Reset(TextInput_Where);
    Reset(TextInput_LessenCover);
    Reset(TextInput_Duties);
    UpdateContext({VarLessen: ""});
    UpdateContext({VarDuties: ""});

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard