cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Button that will concatenate User email and Time and enter into a field - Date Stamp

Hi,

 

I need a button that on select, date stamps along with the users email to a field/column when in New Mode.

I have tried the following to no avail and the update context function (via googling) has me lost to try and get i.e  fred.jones@constco.com - 2018-05-09T17:59:27

 

I tried the following:

"If(IsBlank(Signedby),ThisItem.SignedBy=Concatenate(User().Email,"-",Now()),ThisItem.SignedBy)"

I did try originally "ThisItem.SignedBy=Concatenate(User().Email,"-",Now())"  but did not work did not pass go.

 

So we have a blank column/field that is "SignedBy" which is blank (because form is new), so that when the button is clicked it stamps the User email and the date + time in the field.

Concat and Concatenate seem to be the wrong function for what I am doing - eror messages point this out but no guidance to how to fix.

 

Also when the form is in the edit mode - and the button clicked (will hide it eventally if in edit mode) - I figured that the field would not change because of the else part of the if.

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Button that will concatenate User email and Time and enter into a field - Date Stamp

hi @Anonymous,

Can you share a bit more about your issue?

Can you show me the error info of your issue?

Is ‘signedby column text type?

 

Based on the formula you provided, I think there is something wrong with it.

Currently,Assigning a value to control within another control directly is not supported in PowerApps.

 

I made a test.

8.PNG

Set the default property of datacardvalue4 (Text Input box) to:

If(EditForm1.Mode=FormMode.New, Var1, ThisItem.SignedBy) 

Set the onselect property of the button to:

If(IsBlank(SignedBy),Set(var1, User().Email&"-"&Now()),Set(var1,Parent.Default))

 

on your side, you should type:

If(IsBlank(ThisItem.SignedBy),Set(var1, User().Email&"-"&Now()),Set(var1,ThisItem.SignedBy))

Set the OnVisible property of the Edit screen to following:

Set(var1, Blank())

regards,

Eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
xyzzyx666
Level 8

Re: Button that will concatenate User email and Time and enter into a field - Date Stamp

you can try as this:

Concatenate(Text(User().Email),"-",Text(Now()))

Community Support Team
Community Support Team

Re: Button that will concatenate User email and Time and enter into a field - Date Stamp

hi @Anonymous,

Can you share a bit more about your issue?

Can you show me the error info of your issue?

Is ‘signedby column text type?

 

Based on the formula you provided, I think there is something wrong with it.

Currently,Assigning a value to control within another control directly is not supported in PowerApps.

 

I made a test.

8.PNG

Set the default property of datacardvalue4 (Text Input box) to:

If(EditForm1.Mode=FormMode.New, Var1, ThisItem.SignedBy) 

Set the onselect property of the button to:

If(IsBlank(SignedBy),Set(var1, User().Email&"-"&Now()),Set(var1,Parent.Default))

 

on your side, you should type:

If(IsBlank(ThisItem.SignedBy),Set(var1, User().Email&"-"&Now()),Set(var1,ThisItem.SignedBy))

Set the OnVisible property of the Edit screen to following:

Set(var1, Blank())

regards,

Eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Re: Button that will concatenate User email and Time and enter into a field - Date Stamp

Hi Eason,

 

Following your example I get error messages as per attchemnt.   2018-12-19 09_26_44-SafetyConversation - Saved (Unpublished) - PowerApps.png

And closer image of  error messages per second attachment. 2018-12-19 09_29_35-.png

 

ThisItem.Signedby is a text column.

 

Original eror messaging as per attchement - 2018-12-19 09_33_25-Original-.png with onselect as

If(IsBlank(Signedby),ThisItem.SignedBy=Concatenate(User().Email,"-",Now()),ThisItem.SignedBy) 

 

Kind Regards.

 

 

Anonymous
Not applicable

Re: Button that will concatenate User email and Time and enter into a field - Date Stamp

Yup - took a while - had the button in the wrong part of the form - it was outside the editform1.

When I moved the button to inside the card "SignedBy" - yeah - success.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (7,317)