cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jb007
Level: Powered On

Problem setting Variable to concatenation of text and date field

I have created a button on my PowerApps form that is linked to a sharepoint list which 'on select' sets the variable as follows

Set(varRef,{Value:Concatenate("New_",Text(DataCardValue24.SelectedDate,"ddmmyyyy"))})

It seems to work OK as the result under formula bar is "New_27012021"

The problem is when I focus on another element in the form and then return to the button the formula has been changed automatically to 

Set(varRef,{Value:Concatenate("New_",Text(DataCardValue24.SelectedDate,"[$-en-AU]ddmmyyyy"))}) which no longer provides a  date value ie the result displayed under the formula bar is "New_"

Any suggestions re a fix would be appreciated

3 REPLIES 3
WarrenBelz
Level 8

Re: Problem setting Variable to concatenation of text and date field

Hi @jb007 ,

Yes some of us live in Oz and get used to this one - annoying though it is. Just change it to

Set(varRef,{Value:Concatenate("New_",Text(DataCardValue24.SelectedDate,"[$-en-US]ddmmyyyy"))}) 

and all will be well from then on.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

jb007
Level: Powered On

Re: Problem setting Variable to concatenation of text and date field

You misunderstand my problem: My issue is that Set(varRef,{Value:Concatenate("New_",Text(DataCardValue24.SelectedDate,"[$-en-US]ddmmyyyy"))}) gives a "New_" result ie the selected date part is blank. ie it doesn't give the correct result

If I initially use just  "ddmmyyyy" rather than "[$-en-US]ddmmyyyy" the formula bar indicates a correct value of for example "New_21012021" but as soon as I move from the button and focus on another form object then move back to the button the formula has been changed by PowerApps to Set(varRef,{Value:Concatenate("New_",Text(DataCardValue24.SelectedDate,"[$-en-US] which gives the incorrect result "New_" ie with a blank date part.

WarrenBelz
Level 8

Re: Problem setting Variable to concatenation of text and date field

HI @jb007 ,

Your initial post said it changes to 
Set(varRef,{Value:Concatenate("New_",Text(DataCardValue24.SelectedDate,"[$-en-AU]ddmmyyyy"))}) from [$-en-US] initially. This is a common annoyance I get and the reference in this case simply needs to be changed to  [$-en-US] and saved.

If the issue is different and you are saying the Variable changes value, try putting a label with the Text value varRef and see if the value changes as you move around your elements. If it does not, then there may not be an issue.

Happy to assist further if required.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,552)