cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cammc
Helper I
Helper I

How to Query what display mode a field is in

I'm wanting to query what display mode something is in, in order to trigger off an separate action for an email - the below works perfectly fine - its using a dropdown to say yes or no to trigger it (using it to test the code worked). However I would like to have it check a different field and if that fields display mode is set to edit then trigger.

 

However when I use bt.navsubmitall'.DisplayMode. = edit , it doesn't work, and when I have tried looking up how a query what displaymode a field is in, all I'm getting back is how to set the display mode (which isn't what I need) any help?

If(
    Checksub.Selected.Value = "Yes",
    Office365Outlook.SendEmailV2(
        User().Email,
        "Sales_App_Information_Submitted",
        HtmlTextEmailToSend_1.HtmlText,
        {
            Cc: User().Email,
            Bcc: "xxx@xxx.com",
            Importance: "High"
        }
    ),
    Office365Outlook.SendEmail(
        User().Email,
        "Failed_to_create_Documents",
        HtmlTextEmailToSend_1.HtmlText,
        {
            Cc: "xxx@xxx.com",
            Importance: "Low"
        }
    )
);

  

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @cammc ,

Just use the same If statement as the button, but instead of setting the DisplayMode, send the appropriate email.

 

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

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @cammc ,

Are you referring to the DisplayMode of a Form or another control. If so, what type of control and how are you setting the DisplayMode ?

I have an if statement on a button that determines its display mode, based on other criteria on the app. What I am trying to do is query if that buttons display mode is edit then trigger

NandiniBhagya20
Solution Sage
Solution Sage

Hi,

Assuming you are checking display mode of a field named TextInput1

If(TextInput1.DisplayMode=DisplayMode.Edit, SubmitForm(Form1))

 


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

I tried that initially (minus the submit form as that bit isn't relevant), and added it at the top of my statement in replacement of the checksub value but it still throws and error on the if statement saying if statement has invalid arguments

Hi @cammc ,

Just use the same If statement as the button, but instead of setting the DisplayMode, send the appropriate email.

 

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

isn't exactly what i was wanting to do, as its code duplication, but it does work

Hi @cammc ,

Code duplication (via Ctrl-C / Ctrl-V) is something I am accustomed to . . .

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,165)