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 / FormMode change by com...
Power Apps
Answered

FormMode change by comboBox. But not showing New Form

(0) ShareShare
ReportReport
Posted on by 7

I have a form and a comboBox in same page and sharepoint list as backend. the form defaultMode is New. After user choose a person from the combobox, if the person in the list, the FormMode should be Edit; Otherwise, should be New .

Below is the code for comboBox onChange

If(!IsBlank(LookUp(List, Email =combo.Selected.Email)),EditForm(Form1),NewForm(Form1))

 

Current result is, if the person in the list, the Form1 is in Edit Mode, but if person not in list, Form shows "No Item to Display"

 

Could you please help to give some advice.

 

Thanks

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @BJMLong ,

    I just tested this on a list of mine using the code syntax below on the OnChange of a Combo Box and it worked as expected.

     

    If(
     !IsBlank(
     LookUp(
     List,
     Email = Self.Selected.Email
     ).Email
     ),
     EditForm(Form1),
     NewForm(Form1)
    )

     

    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.

  • BJMLong Profile Picture
    7 on at

    Thank you @WarrenBelz! Could you show me what is your code for Form1.Item and Form1.DefaultMode please.

     

    Thanks a lot

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

    @BJMLong ,

    The DefaultMode does not matter - what is the Item of your Form?

  • BJMLong Profile Picture
    7 on at

    @WarrenBelz 

    My Item is: First(Filter(datasource, Email = combo.Selected.Email))

     

    The wired thing is , when I ran it use ALT key, it looked okay. But when I Preview the App(F5), it showed No Item To Play.

     

    Thanks 

     

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

    Hi @BJMLong ,

    You can change it to

    LookUp(
     datasource, 
     Email = combo.Selected.Email
    )

    but that really should not affect it. The message no item to display will come up in edit or view mode (not new mode as there is no item anyway) - maybe the issue with yours is it is not detecting the blank combo box result. As I mentioned, my model works fine with the logic - I will go back a step separating the result from the action and use a different logic for testing the result.

    With(
     {
     wEmail:
     LookUp(
     List,
     Email = Self.Selected.Email
     ).Email
     },
     If(
     Len(wMail) > 0,
     EditForm(Form1),
     NewForm(Form1)
     )
    )

     

    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.

     

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard