cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimJim
Helper V
Helper V

Referencing a combo box after submitting

Hi Guys,

I have a gallery with various combo boxes on, when a user clicks submit, the data from the gallery controls is sent to a collection. I am trying to hide / display icons if the current item exists in the collection.

The trouble I have is that when a user submits data to the collection, the default values are displayed in the combo box using ThisItem.Supplier, but when I try to reference the combobox using cmb_Supplier.Selected.Result it doesn't return any data. How do I pick up the current text within the combobox?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @v-qiaqi-msft ,

Thank you,

In the end I solved the issue by using the following formula to reference my combo box

If(IsBlank(cmb_Supplier.Selected.Result),
ThisItem.'Supplier',
cmb_Supplier.Selected.Result)

This formula always returns a value

I tried changing my DefaulSelectedItems property from {Value:ThisItem.'Supplier'} to {Result:ThisItem.'Supplier'} but that also did not resolve the issue.

I'm sure there is a better way to solve my problem but my solution is working 😊

View solution in original post

6 REPLIES 6
eka24
Super User
Super User

In the DefaultSelectedItems of the Combobox:

      ({Value: ThisItem.Supplier})

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 , thank you, but perhaps I didn't explain my problem very well.

I already have the code above in the DefaultSelectedItems property of the combo box, the default value is displaying correctly.

The issue I have is that I cannot reference the default value of the combo box. Let's say I have a textbox next to the combo box with a default value of cmb_Supplier.Selected.Result. As soon as I submit the data to my collection, my textbox is blank (even though my combo box displays the correct default value)

eka24
Super User
Super User

Try with a LookUp in the Textbox assuming you have an unique column:

LookUp(CollectionName, ID = ThisItem.ID, ColumnInCombobox)

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @JimJim,

Have you solved your problem?

Could you please tell me that how you set the DefaultSelectedItems property of the Combo Box?

 

Please modify the formula you set for the DefaultSelectedItems property of the Combo Box as below:

{Result:ThisItem.Supplier}
Best Regards,
Qi

Hi @v-qiaqi-msft ,

Thank you,

In the end I solved the issue by using the following formula to reference my combo box

If(IsBlank(cmb_Supplier.Selected.Result),
ThisItem.'Supplier',
cmb_Supplier.Selected.Result)

This formula always returns a value

I tried changing my DefaulSelectedItems property from {Value:ThisItem.'Supplier'} to {Result:ThisItem.'Supplier'} but that also did not resolve the issue.

I'm sure there is a better way to solve my problem but my solution is working 😊

Hi @JimJim,

Glad that you have solved your problem.

Could you please mark your own reply as an answer to help more users who may have the same issue with you.

Thanks for your co-operation.

Best Regards,
Qi

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,250)