cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bjarvis
Level: Powered On

Dynamic label based on FormMode

Hi,

 

I have a form that i want to use for either viewing an existing record, editing an existing record and adding a new record.

I plan on doing this by changing the FormMode on entry to that form.

 

I have 2x buttons that the user can choose 'New' and 'Existing' 

 

The 'New' button has the following in OnSelect:

 

Navigate(scnSurvey_Site, Fade);
NewForm(frmSurvey)

The 'Existing' button has the following in OnSelect:

 

Navigate(scnSurvey_Site, Fade);
ViewForm(frmSurvey)

 

On the form screen, i have the following IF statement in the Label.Text

 

If(!FormMode.New,galExistingSurveyBrowse.Selected.Title,"Site Details")

I want to change the Label.Text depending on whether the screen is entered with NewForm or ViewForm, but it doesn't seem to work.

The label always shows 'Site Details'

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dynamic label based on FormMode

Try somthing like this:

 

If(EditForm.Mode = FormMode.New, "true", "False")


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
2 REPLIES 2
Super User
Super User

Re: Dynamic label based on FormMode

Try somthing like this:

 

If(EditForm.Mode = FormMode.New, "true", "False")


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
bjarvis
Level: Powered On

Re: Dynamic label based on FormMode

Thanks for the reply @Jeff_Thorpe,

 

It seems you can't rely on Powerapps to know which form you're referencing (which in hindsight is obvious) and so you have to specify which form you want to check the FormMode of.

 

So for anyone who finds this in future, the result for my specific example is:

 

If(frmSurvey.Mode=FormMode.New,"New Survey",galExistingSurveyBrowse.Selected.Title)

 

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 120 members 4,564 guests
Please welcome our newest community members: