web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change Drobbox field v...
Power Apps
Unanswered

Change Drobbox field value when in edit mode, use default in new mode - Powerapps, Dataverse for Teams

(0) ShareShare
ReportReport
Posted on by 49

Hi,

 

I have a field that default populates the user email in the form new mode but when I select a record from a gallery, the field changes to the value of the selected record. This has been achieved using the below formulae in the Value property.

 

If(FormBasicInfo.Mode=FormMode.New, User().Email, ThisItem.RaisedbyEmail)

 

 

I want to do the exact same for a drop box field in the same form

At present, I have the following:

Items: Choices(DRF_Status)  

DefaultSelectedItems ["Draft"]

There is no value property therefore it must have to be entered somewhere else.

 

I have experimented with the above formulae in different property fields for the drop-down with no luck. and my search in this forum and on youtube I find similar yet slightly different requirements and I have failed to translate their solutions to meet my objective.

 

Any assistance would be much appreciated, 

Thank you.

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @CrazyCol - could you replace ["Draft"] with {Value: "Draft"} ?

  • CrazyCol Profile Picture
    49 on at

    @Amik I assume you mean within the formula in the defaultSelectedItems property?

    If(FormBasicInfo.Mode=FormMode.New, {Value: "Draft"}, ThisItem.DRFStatus)
    //{Value: "Draft"}
    //["Draft"]

     This returns an error stating ... formula uses scope not presently supported.... 

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    Yes correct. Could you create a brand new form and apply that logic to that field and check if the same error occurs. This will help you identify if there is a problem with your Form.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • CrazyCol Profile Picture
    49 on at

    Same error is showing. 

     

     

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @CrazyCol - that is not an error and is a red herring. Is the Combo Box displaying "Draft" in New Form mode?

     

    You could try other variations, but the same "error" will appear without impacting the output you need.

     

    If(
     FormBasicInfo.Mode = FormMode.New,
     { Value: "Draft" },
     Parent.Default)

     

    If(
     FormBasicInfo.Mode = FormMode.New,
     {Value: "Draft"},
     ThisItem.DRFStatus
    )

     

    If(
     FormBasicInfo.Mode = FormMode.New,
     {Value: "Draft"},
     {Value: ThisItem.DRFStatus}
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

  • CrazyCol Profile Picture
    49 on at

    @Amik yes that's correct, it showed default draft on new form with either

    //{Value: "Draft"}
    //["Draft"]

    , however, once applied, when I select on a record to view or edit, that I know has had its record changed, it still shows Draft.

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @CrazyCol ....so it does work.

     

    If you started with that, it would have saved both of us a lot of wasted time.

     

    What do you have in the Item property of your Form?

  • CrazyCol Profile Picture
    49 on at

    @Amik I am not sure what you mean by wasted time..... the default value was not my issue, it is when I select an existing record to view or edit, it still shows the default value draft regardless of its actual value. In edit/view mode i want it to show its actual value.

     

    Items: Choices(DRF_Status)  

    DefaultSelectedItems was ["Draft"] , {Value: "Draft"} also works.

    I tried the variations suggested above in DefaultSelectedItems property, the same error occurs. 

     

     

     

     

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @CrazyCol again - what do you have in the Item property of your Form?

  • CrazyCol Profile Picture
    49 on at

    @Amik 

    In My original form - Gallery1.Selected

     

    In the new form - If(BrowseGallery1.DisplayMode = DisplayMode.Disabled, selectedRecord, BrowseGallery1.Selected)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard