cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tagustin2020
Power Participant
Power Participant

Logistics Form Unsaved False Positive Due to Special Field Customization

@RandyHayes 

 

Hello Randy,

 

I'm having false positive Unsaved form issues again in a different form this time, the form our Logistics team uses to process requests.

I believe it is possible due to the Shipping Comments field. I took out the default value field and inserted an html text control. 

 

Data Card Default:

ThisItem.'Shipping Dept Comments' 

Data Card Update:

valShipComments.HtmlText 

HTML Text Control Default:

LookUp('Shipping Message Templates', Title= ddStatusLS.Selected.Value, Template) 

 

Is there some logic I can add to the formula below to account for this special field?

If(frmLogistics.Unsaved && frmLogistics.Valid,DisplayMode.Edit,DisplayMode.Disabled) 

 

Any advice would be greatly appreciated!

Teresa

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @tagustin2020 

Not really...the fact is that your HtmlText property is being set to a value that is not consistent with the Default property.  So, for example, your Default of the datacard (ThisItem.'Shipping Dept Comments') could be nothing/blank and your HtmlText property on the Html control is going to return a template (presumably not nothing/blank).  SO, your Default property no longer will match the Update property and your form will always be considered Unsaved.

 

I would start by changing your Html control to reflect the underlying column value if it exists.

Coalesce(
    Parent.Default,
    LookUp('Shipping Message Templates', Title= ddStatusLS.Selected.Value, Template) 
)

 

Now, with that, you will not get Unsaved on existing record. You would still have unsaved for new records or records that are missing a value in that column.

 

Hopefully that makes sense and is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@tagustin2020 

The best way to tell what is causing the issue is to use the Fill trick that I showed you.  Set the Fill property of the DataCard to If(Self.Default<>Self.Update, Red, Transparent)

This will work on simply type columns.  Complex types need a little adjustment to get that result.

But, that will show you visually very quickly what is causing it.

 

As for hidden fields - yes, absolutely they participate in the unsaved property.  Any datacard that "represents" a field in the datasource (hidden or not) will be part of the Unsaved evaluation.  SO...check those too!

 

Custom datacards (not customized, custom) - the field editor for the form does not distinguish visually, they will all say custom.  But the distinction is, "customized" (as I call it) is any datacard that has been unlocked (still shows as (custom) in the field list) and "Custom" is any datacard that has been added from the "Add a custom card" menu (still shows as (custom) in the field list). 

Anyway...just setting the groundwork for this next statement - Custom datacards do not participate in the Unsaved property.  Customized datacards (again, visible or hidden) do.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

15 REPLIES 15

Hi @tagustin2020 

Not really...the fact is that your HtmlText property is being set to a value that is not consistent with the Default property.  So, for example, your Default of the datacard (ThisItem.'Shipping Dept Comments') could be nothing/blank and your HtmlText property on the Html control is going to return a template (presumably not nothing/blank).  SO, your Default property no longer will match the Update property and your form will always be considered Unsaved.

 

I would start by changing your Html control to reflect the underlying column value if it exists.

Coalesce(
    Parent.Default,
    LookUp('Shipping Message Templates', Title= ddStatusLS.Selected.Value, Template) 
)

 

Now, with that, you will not get Unsaved on existing record. You would still have unsaved for new records or records that are missing a value in that column.

 

Hopefully that makes sense and is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Thank you Randy. I entered that formula, but that must not be it as the Save Changes button still isn't working as expected.

 

Another culprit might be the Tracking Numbers field. I didn't mention it at first because it isn't visible unless the status is changed to Shipped, but here are the formulas at play in that Data Card.

 

Data Card Default:

ThisItem.'Tracking Number(s)'

 

Data Card Update:

valTrackingNumbers.Text

 

Text Value Field Default:

If(varTracking, Concat(colTracking, TrackingNumber, ", "), Parent.Default)

 

For the sake of my learning "journey" do hidden fields impact the Unsaved Changes property?

 

Thanks Randy,

Teresa

 

 

@tagustin2020 

The best way to tell what is causing the issue is to use the Fill trick that I showed you.  Set the Fill property of the DataCard to If(Self.Default<>Self.Update, Red, Transparent)

This will work on simply type columns.  Complex types need a little adjustment to get that result.

But, that will show you visually very quickly what is causing it.

 

As for hidden fields - yes, absolutely they participate in the unsaved property.  Any datacard that "represents" a field in the datasource (hidden or not) will be part of the Unsaved evaluation.  SO...check those too!

 

Custom datacards (not customized, custom) - the field editor for the form does not distinguish visually, they will all say custom.  But the distinction is, "customized" (as I call it) is any datacard that has been unlocked (still shows as (custom) in the field list) and "Custom" is any datacard that has been added from the "Add a custom card" menu (still shows as (custom) in the field list). 

Anyway...just setting the groundwork for this next statement - Custom datacards do not participate in the Unsaved property.  Customized datacards (again, visible or hidden) do.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Randy, that's a fantastic trick! I'm sorry, I don't recall you telling me that before. I just went through all of our past communications around Unsaved Changes looking for it and wasn't able to find it, but I'll sure be using it from now on. Would you be kind enough to provide the variations for Choice, People and Date fields? I applied the formula to all of my Text fields and got 2 hits as seen below.

 

Here is the formula I'm using on the Logistics Employee card. 

 

Data Card Default:

ThisItem.'Logistics Employee'

Data Card Update:

valLogEmpLS.Text

Text Value Field Default:

Office365Users.MyProfileV2().displayName

 

Here is the information for the Tracking Number(s) card again for the sake of convenience.

 

Data Card Default:

ThisItem.'Tracking Number(s)'

Data Card Update:

valTrackingNumbers.Text

Text Value Field Default:

If(varTracking, Concat(colTracking, TrackingNumber, ", "), Parent.Default)

I tried this variation based off of the solution you gave me for Shipping Comments, but the card is still red...

Coalesce(Parent.Default, If(varTracking, Concat(colTracking, TrackingNumber, ", ")))

 

2red.png

@tagustin2020 

Yes, it was in this post.  It was not directly about this topic, but it is the exact same thing...trying to visually show the datacards that have changes.

 

Your problem with the Logistics Employee card is with the Text property.  You are not accounting for the underlying record value.  It should be:

Coalesce(Parent.Default, Office365Users.MyProfileV2().displayName)

 

For the tracking number, that is a little different as it would be based on what is going on with varTracking.  

To cut to the chase, change your Text property of that control to :  Parent.Default

The red *should* go away at that point.  If it doesn't then there is something else at foot.  If it does, then the varTracking is true and is going to override the underlying record value.

 

See where that gets you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@tagustin2020 

Oh, and for the other types of columns (Choice, etc.) you have to go inward to the outward - meaning that with the simple formula, we're just on the datacard and are referencing Self (I consider this outward).  To get the choice comparison, we have to go inward to the datacard as we can't compare Default and Update as these are no Records, and PowerApps will not compare a record to a record.

So, for a choice, it would be like this:

   If(ThisItem.ChoiceColumn.Value = yourSelectionControl.Selected.Value, Red, Transparent)

 

So, in the above we are going to the ThisItem record and a specific column and then to any control that would be supplying a record to Update and using one of its columns to compare.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Thanks Randy. Sorry about that. I should have put 2 and 2 together. Thanks for the Choice variation. Both my Status and Shipping Method data cards turned red.

 

Status Formulas:

Data Card Default:

ThisItem.Status

Data Card Update:

ddStatusLS.Selected

Combo Box Items:

Choices([@'Domestic Shipping Requests'].Status)

Combo Box DefaultSelectedItems:

Parent.Default

 

Shipping Method Formulas:

Data Card Default:

 

ThisItem.'Shipping Method'

 

Data Card Update:

 

ddShipMethodLS.Selected

 

Combo Box Items (Power Apps chose the combo box control, not me):

 

Choices([@'Domestic Shipping Requests'].'Shipping Method')

 

Combo Box Default Selected Items:

 

Parent.Default

 

 

When I change the Text property of the Tracking Number(s) field to Parent.Default, the tracking numbers disappear. When I change the Text property of the Employee Name to the Coalesce formula, the Fill is red. I thought working with a Text field would be easier than working with a person field (I tried both), but I guess not...

 

Teresa

 

 

@tagustin2020 

So your formulas look good, so something is afoot!  

 

Let's pick on Employee Name.

Your Text property of valLogEmpLS should definitely be:

Coalesce(Parent.Default, Office365Users.MyProfileV2().displayName)

The Fill property of the datacard should be:

    If(Self.Default<>Self.Update, Red, Transparent)

The Update property of the DataCard should be: valLogEmpLS.Text 

and the Default property of the datacard should be : ThisItem.'Logistics Employee'

Those last two you mention you have, but just wanted to clarify.

 

If that is showing red, then we need to determine why. 

To be clear: For a New record, this will show the displayName from the MyProfileV2 action.  For an existing record, this will show the recorded value in the record column, OR, if the underlying record column is blank, then it will again show the displayName from the MyprofileV2 action.

Are we working with a new record or an existing record?

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Hi Randy,

 

Those are the formulas I have in place. I assume you mean that I should enter the Coalesce formula into the Default property of the value field since I don't see a Text property.

 

LogEmpValue.png

My Logistics form defaults to View mode. OnVisible formula:

UpdateContext({EditLogForm: false}); ViewForm(frmLogistics); SetFocus(txtBarcode); Set(varTracking, false); Set(varDeleteConfirm, false); Set(varPlaySpinner, false)

 

The OnSelect property for the Edit Request button is:

EditForm(frmLogistics);UpdateContext({EditLogForm:true});SetFocus(txtBarcode);

 

Not sure if that helps at all. I know it is getting late where you are. Perhaps we could follow-up tomorrow. Thanks so much for hanging in there with me. 

 

Teresa

 

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 (865)