cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TammyGarris
Helper II
Helper II

Date changes when another user opens form

I am VERY new to PA and have learned everything by watching videos and reading message boards.  My app works really well, but for some reason I keep having a date issue.  My app is built to allow our MDs to audit patient charts when a NP is caring for the patient.   Basically, the MD logs into the app to answer 5 questions about a chart.  They grade it, sign off and the sign date is set to default to Today(). 

After the MD signs off, the NP gets an email that an audit has been done.  The NP logs into the app to their own screen and sees what the MD entered.  They also have to sign off and submit.  Both signature dates are supposed to store in respective fields in Excel.  For some reason, the original MDs signature is being changed to reflect whatever date the NP logs in.  Not an issue if they happen on the same day, but that is rare.  For example, one NP logged in today and signed off on audits done last week. However, the providers signature now says they did the audit today.  

 

My Excel spreadsheet is saved to OneDrive for Business and that is how it's being accessed from the APP.

 

I've also tried this without defaulting the date and it just erases the date the provider initially signed it.  I have the MD field set to disabled when the NP goes in to do their part, but that's not fixing the issue.  HELP!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@TammyGarris 

That is helpful!!

 

I would say that the Signature would be the determining factor for the date.  As in, the signature date should only be set once the signature is entered.  

 

Does this sound right?

 

If so, then your DefaultDate for your datepickers would be based on those textinput controls.

For example, the MD DefaultDate formula would be : Coalesce(Parent.Default, If(!IsBlank(datacardvalueForTheSignature.Text), Today()))

 

What the above does is...if the underlying record has a Date, then it will display that.  If it does not (blank), then IF the signature has a value (not blank), then it will use today's date.

 

Closer?

 

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

23 REPLIES 23
RandyHayes
Super User
Super User

@TammyGarris 

I am assuming you are using an EditForm to do this.

Also assuming there is a DatePicker control in your DataCard for that date and it is the DefaultDate that you have set to Today().

 

If so, then you need to change the property formula to : Coalesce(Parent.Default, Today())

Make sure your Default on the DataCard, has not change from the original.

 

I hope this is helpful for 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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Hi @TammyGarris 

Are you using forms to save the data or are you using a Patch() function?

HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

 

What is the Update/Patch Logic to Excel?

 

I am just thinking that if it is set to Today() for both respective date fields, then basically when it comes to the second time round today is today, being whichever day the last person signing off in the app happens to be.

 

So for the second person in, we want to effectively not patch the first respective date field at all.

 

So I am wondering if it is the same one chunk of logic being used for both updates or two separate ones as to me the first MD date should not even be touched when we come to the second time round.

 

I presume it is the one entry for both sign off dates? If so, the NP screen would want to piggy back off of the same existing row as done by MD. And then when updating, do just a Today() against the ND Sign Off column and no reference to the MD sign off date column.

 

Sorry as that is basically me thinking out loud and saying could I see the update statements or the gist of them. Or even if we just confirm that the first date that we are not wanting to overwrite is excluded from the second update.

 

I am also thinking that perhaps is it just a Submit Form that is occurring, in which case and if both date fields are set to Today() that would be the problem and in that case you would want to exclude the respective date column when submitting or specifically patch accordingly.

 

Again I apologise in advance as I am not used to using Excel as a data source so some of what I said may be way off course but hopefully at least food for thought.

Thank you!  Yes - your assumptions are correct.

Do I need to make this the default on both signature dates?

Forms

I followed you perfectly!  I'm using a submit form.  I don't know how I would exclude one specific field from submitting?  Since the NP portion is only submitting 4 fields, what would I make my formula?  

Drrickryp
Super User
Super User

@TammyGarris 

Coalesce(Parent.Default,Today()) in the Update Property of the date cards.  If there is already a date in the card field, it will stay the same and if the date field is blank, the current date will be submitted.  

@TammyGarris 

Did you attempt my suggestion?

Coalesce(Parent.Default, Today()) in the DefaultDate property of the DatePicker?  Your Update property of the datacard should remain as the nameOfYourDatePicker.SelectedDate

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Still not sure if I'm supposed to put the Coalesce formula in both the MD Update Property AND the NP Update Property or just one?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,261)