cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nesh
Frequent Visitor

Set Blank Value when New Form Mode and Show Selected Value when Edit Form Mode

Hi!
Please help me with my issue,

looks like simple but it bothers me so much.

So, let me say that I have 4 drop down and each drop down have 2 items: ["","(name_activity)"].

What I want to do is when users want to input new data, the drop down will have a blank value for default,

but when users want to edit data, the drop down will show the recorded selected data in Excel Database.

 

I use this formula in default field of each data card, for example for activity_1_datacard:

 

 

If(EditForm1_1.Mode=FormMode.Edit,ThisItem.activity_1,activity_1="")

 

 

It works well when the users input the new data (FormMode.New) , but when the users want to edit the data the issue appears, this the example of the case:
Once, user only want to input new data (let me say data_1) in drop down activity_1, and left drop down activity_2...4 in blank for default.

But in other time, user want to go back to data_1 to input value in drop down activity_2 but leave drop down activity_3..4 in blank value. When user opens the edit form of data_1  (FormMode.Edit) to input drop down activity_2, drop down activity_2...4 automatically isn't blank anymore and have their value (drop down activity_2 with name_activity2 .... etc).

What should I do?

 

Best Regards.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Nesh ,

 

Set Default property: Parent.Default ---> This default for drop down or DataCard, and if for the drop down so the DataCard will only have default ThisItem.activity_1, right?

-- Yes, it is for dropdown, and the datacard Default property is ThisItem.activity_1. then the drop down will automatically show blank when new the Form if the dropdown AllowEmptySelection property is true.

Sik

View solution in original post

6 REPLIES 6
MatthewInwards
Resolver II
Resolver II

To be honest, the easiest way to do this would be to have a separate form for creation of records than you have for the editing of records.

 

If this is not possible for you then you could try to put the default formula on the actual drop-down rather than the data card.

 

Hope this helps, if not then send me a message and I will try to assist in further detail.

Hi @MatthewInwards,

 

Thank you for your reply.

I will try to put the default formula on the actual drop-down first.

 

But can you tell me more detail about that? So I can make sure my formula is correct?

Best Regards.

v-siky-msft
Community Support
Community Support

Hi @Nesh ,

 

Originally there were four text boxes, but you changed them to four drop down, right?

What is the Update property of dropdown data cards? How do you save the form? By SubmitForm function or Patch function?

When the user only select drop down activity_1 and leave drop down activity_2...4 in blank, please check if Activity2/3/4 columns in Excel are assigned values.

 

To the first expectation that when users want to input new data, the drop down will have a blank value for default, Just set the AllowEmptySelection of Drop down: true, Set Default property: Parent.Default, then the dropdown will select blank when Form is New mode. So, there is no need to add "" blank value into dropdown item.

Please have a try this to check if your issue is fixed?

If not, please share the details mentioned above.

Sik

Hi @v-siky-msft,
Thank you for your reply, and for your questions:

Originally there were four text boxes, but you changed them to four drop down, right? ---> Yes

What is the Update property of dropdown data cards? How do you save the form? By SubmitForm function or Patch function?---> By SubmitForm (I don't have any other idea yet because I am newbie so I left it in standar function)

 

When the user only select drop down activity_1 and leave drop down activity_2...4 in blank, please check if Activity2/3/4 columns in Excel are assigned values.--> for the New Form, the data in Excel for activity_2...4 will be blank but after user open EditForm, activity_2..4 will have name_activity2..4 value.

 

To the first expectation that when users want to input new data, the drop down will have a blank value for default, Just set the AllowEmptySelection of Drop down: true, Set Default property: Parent.Default, then the dropdown will select blank when Form is New mode. So, there is no need to add "" blank value into dropdown item.

Set Default property: Parent.Default ---> This default for drop down or DataCard, and if for the drop down so the DataCard will only have default ThisItem.activity_1, right?

 

Best Regards.

 

 

 

Hi @Nesh ,

 

Set Default property: Parent.Default ---> This default for drop down or DataCard, and if for the drop down so the DataCard will only have default ThisItem.activity_1, right?

-- Yes, it is for dropdown, and the datacard Default property is ThisItem.activity_1. then the drop down will automatically show blank when new the Form if the dropdown AllowEmptySelection property is true.

Sik

abimk9
Regular Visitor

This is has started affecting me now. I'm in the latest version of Power Apps.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,242)