cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jasperr
New Member

Parent.Default and [BarCodeName.value] on COMBOBOX?

How would I go about creating a combobox on my form to present the parent.default if applicable and/or to auto select from the list based of a barcode scan data.

 

 

My form Item is as follows: "LookUp(RecordInventory, ID = SelectedItemID)"

The combobox field is "PartNo"

 

The scanned data would also already on the combobox's list of selections. 

4 REPLIES 4
RandyHayes
Super User
Super User

@Jasperr 

This will be completely dependent on the Items property of your combobox.

You will need to utilize the DefaultSelectedItems (DSI) property of the Combobox to contain a record that matches something in your Items table.

This can most certainly be based on a scanned value.

 

As for the Parent.Default.  I assume you have your Combobox in a form based on the interest in that property, so the only concern over the Parent.Default will be in the scenario of editing an existing record.  If your form is only for the purpose of entering new records, then you don't need to worry about the Parent.Default.

If you are editing, then you can make use of the Coalesce function to return the first non-blank value - i.e. Parent.Default, scannedValue, etc

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes, my combobox is form based. 


So the form would be to do both actually. Enter in new Data and to edit previously enter data.

That being said, it struck me, perhaps I can just seperate/duplicate the two forms one for New data (which would be using the barcode) and one for editing previous data.

However, 1. Coalesce doesn't like that my Barcode data is a value/text when the combobox is asking for a Record. 2. I also noticed when I did manage to get the Combobox to select the scanned data, that it wasn't ever saving that data for that field. Every time I would go to edit the newly added data, the field would be completely blank. (and this was when "Parent.Default" was not listed in the DefaultSelectedItems Property.)

This is my Items property: Choices([@RecordInventory].PartNo)

RandyHayes
Super User
Super User

@Jasperr 

You definitely don't want to duplicate forms for this.  Too often people separate New, Edit and View forms when it is not needed - an Edit form can do all of the above.

 

Yes, as mentioned, you need to match the record of the Items table in the DSI.

So specifying just the value by itself will not be a record.  Since your Items are based on the Choices function, I would assume that PartNo is a Choices column (please correct me if not, as it will be a different outcome).

So, your DSI would be:

   {Value: Coalesce(Parent.Default, yourScannedValue)}

 

As for saving this...what is your Update property on the DataCard and what is the underlying data column type?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
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.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,911)