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 / Change value variable ...
Power Apps
Unanswered

Change value variable on condition

(0) ShareShare
ReportReport
Posted on by 25

Hello; I want to change the value of my variables if and certain condition happens or not.

 

This is my code:

 

If(
Auswahl.Selected.Value = "Büro";
(
Set(
varTeamName;
FeldBereich.Selected.Value
);;
Set(
varEintrittsdatum;
DataCardValue24.SelectedDate
)
);

(
Set(
varTeamName;
FeldTeam.Selected.Value
);;
Set(
varEintrittsdatum;
DataCardValue25.SelectedDate
)
)
);;

Categories:
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @jakobrieder ,

    Apart from the bracketing (I have deleted some not required), this should work

    If(
     Auswahl.Selected.Value = "Büro";
     Set(
     varTeamName;
     FeldBereich.Selected.Value
     );;
     Set(
     varEintrittsdatum;
     DataCardValue24.SelectedDate
     );
     Set(
     varTeamName;
     FeldTeam.Selected.Value
     );;
     Set(
     varEintrittsdatum;
     DataCardValue25.SelectedDate
     )
    );;

     

    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.

    Visit my blog Practical Power Apps

  • jakobrieder Profile Picture
    25 on at

    @WarrenBelz Thanks for the help the first part of the Code works, but the second variable varEintrittsdatum has to store a date that the user is putting in the form but it doesn't store anything. Do i have to change the initialization of the variable?

  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @jakobrieder ,

    The logic of the code is 

    If the selected item in the Auswahl drop-down is "Büro" then

    • set varEintrittsdatum to the date selected in DataCardValue24, otherwise
    • set varEintrittsdatum to the date selected in DataCardValue25

    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.

    Visit my blog Practical Power Apps

     

     

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard