web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Variable as default va...
Power Apps
Unanswered

Variable as default value for Data Card doesn't refresh

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone!
I have an edit form that is displaying different monetary values. In order to show them in correct formating, I have set the default values to variables like "varCateringCost". The onchange property is then set to:

 

Set(varCateringCost;
Text(Value(DataCardValue1.Text);"[$-de-DE]€ ###.##0"))

 

This works absolutely fine with all cases except of one:

If I change from 200 to 300, eg, it correctly displays € 200 and then € 300.
However, I realized, if I completly delete the text inside the input field, it looks to the user as if it was blank, but it still patches the old value to the sharepoint list. I created a workaround:


Set(varCateringCost;
If(IsBlank(DataCardValue1.Text) || DataCardValue1.Text = "" || IsEmpty(DataCardValue1.Text);
Text(Value("0");"[$-de-DE]€ ###.##0");
Text(Value(DataCardValue1.Text);"[$-de-DE]€ ###.##0")))


This works fine the first time. For example, changing fom € 300 to empty, it is displaying € 0 and thus should also patch 0.
However, if I remove "€ 0" again, the field is just staying empty. I tested the value of the variable outside the data card. The value seems to be "€ 0". This however is not correctly displayed inside the data card. I assume, the variable varCateringCost, which is the default value for the datacardvalue1 field, is not refreshed properly. Does anyone have an idea what to do? I am absolutly open for different ways of solving this. The only thing I need is the correct submission of an empty or blank field to the sharepoint list. Thanks a lot in advance!

Categories:
  • Delid4ve Profile Picture
    795 on at
    Scrap the variables, reset it to how it was and put a label next to the input field with “€” in it,
    If you want to be really clever you can put a rectangle around it all (position behind) to put a border around the whole lot so it appears as one box
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    I've made a similar test and met the same problem.

    I've reported this issue to our product team. If there's any replay, I will leave  message here.

    Firstly, I suggest you separate number and "$" like @Delid4ve  said. Then you could avoid the situation of not display "$".

    Secondly, I suggest you not use variable to justify whether the textinput has value. Then you could avoid the default value becoming blank.

    You could set this field's UpDate directly:

    If(IsBlank(DataCardValue1.Text),0,Value(DataCardValue1.Text))

    In this way, you could make sure that the update value is right.

     

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi @Delid4ve and @v-yutliu-msft !
    thanks a lot for your response! 
    However, the currency formatting with "###.###" and the currency sign "€"  need to be included. Especially the dot between the thousands digit and the hundreds digit. If I continue as suggest, I think the formatting is not happening anymore. Is that correct? Any ideas what else I could do? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard