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

Combobox DefaultSelectedItems Edit Form

Hi 

 

I'm new to Power Apps but very enthousiastic about it. My first basic Form App is almost finished and is based on Excel stored on Onedrive.

 

The only thing which I don't get working is in the Edit Form Mode to keep the Entry of the combobox (Multiple Selection not allowed).

 

I googled around and tried a lot of different options for DefaultSelectedItems like:

 

If( EditForm1.Mode =1; ""; Parent.Default ) -> Error Text Value expected Table Value

If( EditForm1.Mode =1; ""; Table( { Value:Parent.Default} ) -> Error Text Value expected

If( EditForm1.Mode =1; ""; Filter(Überbauung; strasse = Parent.Default ) ) -> Error Table Value expected Text Value

If( EditForm1.Mode =1; ""; LookUp(Überbauung; strasse = Parent.Default) ) -> Error

 

I also tried concat without success.

 

Can someone helpme?

 

Many thanks in advance.

 

Regards,

Marc

2 ACCEPTED SOLUTIONS

Accepted Solutions

@marczh ,

Yes

If(
   EditForm1.Mode=FormMode.Edit;
   {strasse:Blank()}; 
   {strasse:ThisItem.strasse} 
)

 

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.

View solution in original post

marczh
Frequent Visitor

@WarrenBelz Thank you very much!

For my next project i will try to avoid excel.

 

It is working now thanks to your input with the following code

 

If(
   EditForm1.Mode=1;
   {strasse:Blank()}; 
   {strasse:Parent.Default} 
)

 

 

View solution in original post

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @marczh ,

You did not mention the field name in Excel, but you need (I assume you are referring to New mode)

If(
   EditForm1.Mode=FormMode.New;
   {Value:Blank()}; 
   {Value:ThisItem.FieldName} 
)

 

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.

thank you for your response. 

 

I am referring to Edit Mode. There the value of the combobox is empty instead of showing the record. 

 

That's why i tried Value:

 

If( EditForm1.Mode =1; ""; Table( { Value:Parent.Default} ) 

 

I also tried without the Table Function, which is not working either.

 

Parent.Default (as for dropdown and text fields)

 

Creating a New Entry everything works fine. 

@marczh ,

What are the Items of the combo box? If they are based on a field name

If(
   EditForm1.Mode=FormMode.Edit;
   {FieldName:Blank()}; 
   {FieldName:ThisItem.FieldName} 
)

 

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.

marczh
Frequent Visitor

The items of the combobox are stored in an excel (onedrive) (Table Name: Überbauung, Fieldname: strasse) and are a list of text values.

 

So I guess, I need to refer to the fieldname of the Excel Spreadsheet?

@marczh ,

Yes

If(
   EditForm1.Mode=FormMode.Edit;
   {strasse:Blank()}; 
   {strasse:ThisItem.strasse} 
)

 

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.

View solution in original post

marczh
Frequent Visitor

I tried your code, but still getting an error message:

marczh_0-1629199183262.png

Any idea why?

 

Many thanks for your assistance, I really appreciate it!

 

Hi @marczh ,

Just tested it here on a SharePoint Text field and works perfectly - you can try "" instead of Blank()

I have not for very good reasons used Excel for a very long time - you might watch this video

WarrenBelz_0-1614034878386.png

marczh
Frequent Visitor

@WarrenBelz Thank you very much!

For my next project i will try to avoid excel.

 

It is working now thanks to your input with the following code

 

If(
   EditForm1.Mode=1;
   {strasse:Blank()}; 
   {strasse:Parent.Default} 
)

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,561)