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 / Update automatically a...
Power Apps
Unanswered

Update automatically a dropdown (DataCardValue)

(0) ShareShare
ReportReport
Posted on by 18

I try to update a Datacardvalue that have DisplayMode.Disabled, automatically when i submiform with this code:

 

If(
DataCardValue12.Selected.Value = "SI";
DataCardValue12.Selected.Value = "NO";
SubmitForm(EditForm1) &&
Navigate(BrowseScreen1; ScreenTransition.Fade)
)

 

But this code don't run

 

The datacardvalue is a dropdown that contains in Microsoft List the values ''SI" & ''NO''

 

Thanks!!

Categories:
I have the same question (0)
  • AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @Rober1 

    To dynamically set a dropdown to an Option you can use Set function the code for this would be: 

    Set(VarSelectedItem,"SI")

    and then in the Default Property of the Dropdown you would want to use this: 

    If(!IsBlank(VarSelectedItem),VarSelectedItem,"1")

    But I am unsure what your trying to achieve with the above code as you don't need && you need to separate functions with a ; so it should be this: 

    If SI and NO Do the same thing: 

     

    If(
    DataCardValue12.Selected.Value = "SI"||DataCardValue12.Selected.Value = "NO",
    SubmitForm(EditForm1);
    Navigate(BrowseScreen1, ScreenTransition.Fade))

     

     

    If the SI and NO do different things: 

     

    If(
    DataCardValue12.Selected.Value = "SI",
    SubmitForm(EditForm1);
    Navigate(BrowseScreen1, ScreenTransition.Fade),
    If(DataCardValue12.Selected.Value = "NO",
    SubmitForm(EditForm1);
    Navigate(BrowseScreen1, ScreenTransition.Fade)))

     

     

    Also an If function needs you to supply the True  for each Condition you are testing so the Syntax is If(Condition, True Function, Else Function) here you will need a nested If or you could replace this with a Switch Statement: 

     

    Switch(
    DataCardValue12.Selected.Value, 
    "IS",
    SubmitForm(EditForm1);
    Navigate(BrowseScreen1, ScreenTransition.Fade),
    "NO",
    SubmitForm(EditForm1);
    Navigate(BrowseScreen1, ScreenTransition.Fade))

     

     

    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. Remember, you can accept more than one post as a solution. If the content was useful in other ways, please consider giving it Thumbs Up.


    Thanks
    Andrew

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard