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 / Clear label after saving.
Power Apps
Answered

Clear label after saving.

(0) ShareShare
ReportReport
Posted on by 126

Hello.

 

I have a menu where the user should save the data. After that, I would like all the labels on that menu to be blank.

How can I do that?

 

If(!IsBlank(varRecord),
Notify("Your request was submitted!", NotificationType.Success),
Notify("Your request was not submitted... Please try again.", NotificationType.Error)
);

 

 

Thank you.

Categories:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    @RLeite wrote:

    Is it possible to write some code on the "ON SELECT" property that users need to click to save?


    Here are some more detailed steps:

    1. In the same "On" property as the one that creates varRecord, place another line of code: UpdateContext({varVisible: false})
    2. In the OnVisible property of the same screen put this line of code: UpdateContext({varVisible: true})
    3. In the Visible property of each label you wish to control, put varVisible

    This will turn off the labels at the same time that varRecord is populated and they won't turn back on until you leave and then browse back to the same screen. If you need to make them visible sooner than that, you will need to add UpdateContext({varVisible: true}) to another "On" property of another control in a way that activates when you want it.

     

  • RL-26071304-0 Profile Picture
    126 on at

    Is it possible to write some code on the "ON SELECT" property that users need to click to save?

  • RL-26071304-0 Profile Picture
    126 on at

    Is it possible to write some code on the "ON SELECT" property that users need to click to save?

  • BCLS776 Profile Picture
    8,994 Moderator on at

    @RLeite wrote:

    It doesn't work because when I go to the previous screen and then return to this menu, those labels are empty. And they should not be...


    OK, then we need to use a different condition than IsBlank(varRecord) to control the visibility of these labels. If the existence of the record is not the right toggle (because it resets when changing screens), does your app have another one we can use? If not, then consider creating another context variable to use on that screen for controlling the visibility of the labels.

     

  • RL-26071304-0 Profile Picture
    126 on at

    It doesn't work because when I go to the previous screen and then return to this menu, those labels are empty. And they should not be...

  • BCLS776 Profile Picture
    8,994 Moderator on at

    OK, you can also toggle the Visible property of each label with this code:

    If(IsBlank(varRecord), true, false)

     

  • RL-26071304-0 Profile Picture
    126 on at

    Thank you for yor answer. 

     

    This is my code, on "ON SELECT" property:

    2022-03-29_14h06_01.png

    What I would like is after the message "Your request was submitted!", all the labels turn blank (or hidden).

     

    Thank you. 

     

  • BCLS776 Profile Picture
    8,994 Moderator on at

    If you are talking about a label (not a text input), then you will need to have some sort of conditional logic in the Text property:

    If(!IsBlank(varRecord), // a variable to indicate a submission has happened
     "", // An empty string to show a cleared label
     "Some text" // for when a submission has not yet happened
    )

    Hope that helps,

    Bryan

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
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard