For each field a user can edit, I have added a yellow triangle to signify that field has been changed and needs to be saved. At the top of the form, I have a warning text label that says to "Please Save Changes" if it sees that any of my forms are Unsaved. For dropdowns, date fields and checkboxes, the warning at the top of the form and the yellow triangles works flawlessly. If I change them, the warnings appear. If I remove my changes, the warnings disappear.
However, for Text fields it's a different story. In the card of a Text field, I've added a yellow triangle with the Fill property showing this:
If (Parent.Default = DataCardValue1.Text,
RGBA(0,0,0,0),
RGBA(212,175, 55,1)
)
Where the other fields work as expected, the Text fields are not.
This only seems to affect text fields that are originally blank, added to, then made blank again. I've tried adding additional code to the Fill property comparing if the fields are blank. That seems to work but only on a visual level. The warning at the top of the page still remains since for some reason something behind the scenes thinks the form is Unsaved.
Can someone help me here?
Solved! Go to Solution.
Hi @PowerAppsHori ,
Thanks for the detailed info, and it makes a lot more sense.
The behaviour is as a result of directly comparing the text input value with the Parent.Default value;
Is Input.Text=Parent.Default?
True while Parent.Default is Blank() and nothing has been entered.
False while Parent.Default is Blank() and something has been entered and deleted.
We already know this doesn't work as expected once someone has entered something and then deleted it - the reason being we start by comparing Blank() with Blank(), but as soon as something and deleted this changes to "" so we're comparing Blank() with "".
Resetting the control using the OnChange: property solves one side of this by ensuring we're comparing Blank() vs Blank() again - but it doesn't fire unless the user moves off the control which is behaviour you don't want.
The answer lies in how we test the condition - we still want to test if Input.Text=Parent.Default, but we need a special test if Parent.Default is actually Blank() to begin with.
Change your warning icon and label Color: property to this;
If (IsBlank(Parent.Default), //logic for blank vs empty
If(IsBlank(DataCardValue1.Text), //returns true if input text is Blank() or ""
Transparent, //hide
RGBA(212,175, 55,1) //show
),
//if the parent default is not blank (there is a saved value)
If(Parent.Default=DataCardValue1.Text, //if what's saved = what's in the input, nothing has changed
Transparent, //hide
RGBA(212,175, 55,1) //show
)
)
You should be able to now remove the OnChange: event code entirely.
Hope this helps,
RT
Does this solve for the overall warning message and disabling the gallery? I'm actually currently able to make the icon disappear when you remove all the text, but if you do it immediately after entering text, the warning on the page still remains and the gallery remains disabled too.
The solution has to somehow tell the Form.Unsaved property that we're back to normal, but I can't figure out how.
Hi @PowerAppsHori ,
I wasn't using the Unsaved property in the previous example - just a condition check. If your gallery and main message are using the Unsaved property then they will behave differently.
The only way Unsaved goes back to false in this scenario (once someone has edited a text field and then cleared their edit by deleting or backspacing their entry), is to reset the text input control with a Reset() function, (or reset the entire form with a ResetForm() function which does the same thing but for the entire form).
Performing a Reset() or a ResetForm() is an action that can only be fired by a behaviour property - which is why we originally used it on the OnChange: property of the text input. Unfortunately it has the focus drawback in that someone has to move focus off the control for the OnChange: event to fire. We can use in-line logic in the Color: property of the warning icon to avoid the Onchange: limitation, but then we're not resetting the control so Unsaved doesn't work. Your gallery and message logic are using the Unsaved property (which looks at all the fields in the form together) - so they will still fail to revert with this scenario. It's a bit of a catch 22.
The only way I can think of to get around this is for your Gallery and main message to use in-line logic like your warning icon instead of Unsaved. This means however that you have to create your own "Unsaved" logic to test the value of each and every form input field against its original value in the source - like Unsaved does - but cater for originally Blank() values that become empty strings after editing and clearing - which Unsaved does not do unless you do a Reset().
It's a pain, and a lot of work - so probably not something you want to do - you should consider the effort vs the benefit.
As an example, assuming the Item: property of your form was based on a gallery selection (Gallery1.Selected) and there were three text fields in the gallery source (Field1, Field2 and Field3) - then the logic we want to use would look something like this;
And(
(IsBlank(DataCardValue1.Text) && IsBlank(Gallery1.Selected.Field1)) ||
(DataCardValue1.Text = Gallery1.Selected.Title), //no changes
IsBlank(DataCardValue2.Text) && IsBlank(Gallery1.Selected.Field2) ||
(DataCardValue2.Text = Gallery1.Selected.Field2), //no changes
IsBlank(DataCardValue3.Text) && IsBlank(Gallery1.Selected.Field3) ||
(DataCardValue3.Text = Gallery1.Selected.Field3) //no changes
)
Here, like in the previous example, we're using IsBlank() on each value separately instead of directly comparing them to each other. We do this because IsBlank() does some handy type conversions for us when used in this way, and will return true even when one value is Blank() and the other value is an empty string, which a direct comparison won't do. If that's true, OR if the source value does actually equal the entered value, then the result is true.
And() tests all the conditions we stipulate, and only if all of them resolve to true would the final output be true - if any one of them is false the final output is false. This lays the foundation for testing all the fields in the form.
Lastly, to apply the logic, you have a main message you want to show or hide, and you have a gallery you want to disable or enable based on that result - so instead of repeating that (presumably massive) chunk of code on both your gallery and your message (or every time you want to perform the same check on the same page on another control), it might be better to put the code once into a text label and check the label output instead. This allows you to "reuse" that same piece of code multiple times, and if you need to adjust your logic, you only have one place to do it - which just makes things a little easier and neater.
To do that, create a label on your screen somewhere and called it "myUnsavedLabel" - you can hide it by setting its Visible: property to false, but set it's Text: property to the above And() function logic that applies to your form and fields.
Note, as it's a Text label, while the output of the formula is a boolean true or false result, it's converted to text result in the label Text property - i.e. "true" or "false".
With this in mind, your gallery DisplayMode: property can now be updated to logic that looks like this;
If(myUnsavedLabel.Text = "false", //there are some changes
DisplayMode.Disabled,
Displaymode.Edit)
if you're using the Visible: property to show or hide your main message then it would look like this;
myUnsavedLabel.Text = "false"
or if you're using the Color: property of your main message to make it transparent instead of hiding it then it might look like this;
If(myUnsavedLabel.Text = "false", //there are some changes
RGBA(212,175,55,1),
Transparent)
That's it.
I hope this explanation and the examples help,
Kind regards,
RT
It's not the answer I want but it's the answer lmao!! Thank you soo much!!!
I have a related question maybe you might know the answer to:
Unsaved Message Pops Up When I First Click Gallery... - Power Platform Community (microsoft.com)
I asked Reza Dorani since I used this video, and he said it looks like it's a bug with the Attachments card and to ask on here. Hoping you can help!
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!
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
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.
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