cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbrines
Post Prodigy
Post Prodigy

Help with updating Text Labels with Person and Date/Time

Hi Guys,

 

Below is an App edit page

 

When I click on Yellow Card Sent I want it to put the current user of the app display name as well as update the field in the SharePoint List

 

When I click on the Yellow Reason I want it to put in the current date and time as well as updating the field in the SharePoint List.

 

 

Currently in the OnChange of the button field of Yellow Card Sent I have

 

UpdateContext({var2:User()})

 

And on the Update of the Yellow Issued By I have tried below, but it doesn't like it as it is expecting a record value

 

var2.FullName

 

Username1.JPG

 

Currently for Yellow Reason OnChange I have

 

UpdateContext({var:Now()})

 

On the Yellow Issued Date card I have 

 

var

 

The issue with the date and display name part is that when I click on + to create a new item the date and display name are put in instead of waiting for me to make my changes.

 

John.

 

45 REPLIES 45

@RandyHayes it is showing in the list and the app. When you first add the date it works fine but after you submit it the time is changed to 00:00

 

Date issue1.JPGDate issue2.JPG

RandyHayes
Super User
Super User

@jbrines 

So, what I need to know is, that space between your pictures.  When you submit that record...what is in the datasource?  Does it have the correct time in the list (not in your app, in the list)?

_____________________________________________________________________________________
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  The data source is a SharePoint List. No it doesDate issue3.JPGn't have the correct time on the list

RandyHayes
Super User
Super User

@jbrines 

So, this stems back to a mistake I made in message #20.  Your Update property should be DateTimeValue not DateValue.  DateValue returns just the date portion of the text, DateTimeValue will include the time as well.

Sorry I didn't catch that a while ago.

_____________________________________________________________________________________
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 Many thanks again, working a treat.

 

John.

@RandyHayes  me again 😂

 

This issue I think (believe) I have caused. I change the Yes/No for the Yellow and Red cards to Choice fields but I was sure I changed it before you came to the rescue. Now the Yellow/Red Card options are giving an error they are expecting a Boolean. When you toggle them in the app they change but when you save it defaults back to off.

 

Is there a quick what in the app to change them to a choice field?

 

John.

RandyHayes
Super User
Super User

@jbrines 

Hi again! 😁

 

What do you mean by "Yellow/Red Card options"?

So, you have a toggle for the Yes or No and this is back-ended by a choice column?

If so,

1) what are the choices in the column?

2) what is the Default property of your Toggle?

3) what is the Update property of the datacard with the toggle?

4) what is the Default of the datacard with the toggle?

_____________________________________________________________________________________
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 

Yellow/Red Card Option what I meant was changing Yellow Card to Yes

 

1) This was a Yes/No and I changed it to a Yes/No Choice 

 

YesNo1.JPG

 

2) Parent.Default

3) DataCardValue11.Value

4) ThisItem.'Yellow Card Sent'

 

4) is the one with the issue where it is expecting the Boolean

 

John.

RandyHayes
Super User
Super User

@jbrines 

Very good.

 

So on the Default of the DataCard:

    ThisItem.'Yellow Card Sent'.Value = "Yes"

 

And on the Update property of the DataCard:

    {Value: If(DataCardValue11.Value, "Yes", "No")}

 

That should do the trick.

_____________________________________________________________________________________
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 

 

First one worked but not the second one.

 

Warning6.JPG

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,434)