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 / Default Mode of form c...
Power Apps
Answered

Default Mode of form change based on ID

(0) ShareShare
ReportReport
Posted on by 182

The Form mode should change if the ID exists ? The below formula is not working. Please advise.

 

2021-07-11_11-59-55.png

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

    @Sajith ,

    Assuming you are selecting the form from a gallery - the test would be 

    If(
     GalleryName.Selected.IncidentID=0,
     FormMode.New,
     FormMode.Edit
    )
    

    However I suspect you are not selecting form a gallery. Also the conundrum you have is that a new form has no data,  therefore no IncidentID (so it will never be 0 and you have a potential circular reference)

    What exactly are you doing when navigating to this form and what is the logic of the test?

  • Sajith Profile Picture
    182 on at

    Yes, I am not selecting from a gallery. I am navigating from  screen1 to Screen2 and capturing Incident ID in Screen2. When I am in Screen2, Incident ID may or may not be there. If it is there, New Form otherwise Edit Form.

    2021-07-11_14-44-40.png

    Item property of Form as follows. 

    LookUp('Incident Resolution',IncidentID=vGlobalID)

  • Verified answer
    WarrenBelz Profile Picture
    156,532 Most Valuable Professional on at

    Hi @Sajith ,

    What I posted originally would probably work, but better on the OnSelect of the Gallery

    If(
     ThisItem.IncidentID=0,
     NewForm(YourFormName),
     EditForm(YourFormName)
    );
    Navigate(YourScreenName)
    

    then the DefaultMode of the Form can be whatever you want (View/Edit/New).

     

    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.

     

     

  • Sajith Profile Picture
    182 on at

    Thanks for help. I am using a button instead of gallery. Your approach guided me.

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard