cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lg270492
Advocate II
Advocate II

Populate text input based on combobox selection

Hi All, 

 

I was wondering again if I could have some help, I am once again pulling my hair out! Sorry I am pretty new to all of this 😞

 

I have a dropdown box providing a list of shipping plants - Distinct('Sales Order Tracker','Shipping Plant Legacy')

 

The dropdown box then filters the results of my combobox for order numbers.

 

The order number combobox items property is - Filter('Sales Order Tracker','Shipping Plant Legacy' = Dropdown2.Selected.Result).'Blackout Order #'

 

Now I have some text inputs which I would like to automatically populate based on the selection of the pre-filtered combobox and for the life of me I cannot work out how to do this. 

 

PLEASEE HELPP MEEEE!  

19 REPLIES 19

Try this one

With
(
    {si:OrderNo_Combo.SelectedItems}
   ,If
    (
       !IsBlank
       (
          si
         ,LookUp
         (
            'Sales Order Tracker'
            ,'BLACKOUT_ORDER_NUMBER_COLUMN'=First(si).Result
         ).'Carrier Name'
        )
     )
)

@lg270492 replace  BLACKOUT_ORDER_NUMBER_COLUMN with the name of your Blackout Order # Column

lg270492_0-1665058960502.png

 

@lg270492 

 

Actually, before I can provide a formula, there is something to note

You can't LookUp on the Carrier Name based on the values of that ComboBox, because that ComboBox only has one piece of data, the blackout order number, isn't that right?

Before, you wanted to take the Distinct of them - so multiple records may have same blackout order #

So you have to try something else, other than LookUp

 

First you may need to Filter rather than LookUp. Then you need to decide how do you want to pick one exactly?

 

Since you already took the Distinct, it's going to be tricky to get back to the original Record again - you took Distinct, right? Which implies you no longer cared which Record it was tied to.

 

Even without the Distinct, you have this for ComboBox Items

Filter('Sales Order Tracker','Shipping Plant Legacy' = Dropdown2.Selected.Result).'Blackout Order #'

You still have just the Blackout Order Number. So the Selected Item from that ComboBox will be just a Blackout Order #, not the original Record it was tied to.

 

So how do you decide what Record you want to prepopulate from exactly in the first place?

You can't LookUp on the Carrier Name based on the values of that ComboBox, because that ComboBox only has one piece of data, the blackout order number, isn't that right? - Correct it will have a blackout order # selected by the user.

 

Before, you wanted to take the Distinct of them - so multiple records may have same blackout order # - Each blackout order number is unique. The distinct is on the shipping plant to remove duplicates.

 

So how do you decide what Record you want to prepopulate from exactly in the first place? - Once a shipping plant is selected and then a blackout order number the values I want to populate in the text input fields are unique to that selected order always.

 

Does this make sense? 

lg270492
Advocate II
Advocate II

Hi @poweractivate any more ideas on this please? 

 

Really struggling and its holding up my project 😞

 

Appreciate it! 

@lg270492 

 

OK so the answer is you LookUp on the Blackout Order #

 

Let's suppose you have a Column called OrderDescription

And suppose you have a Text Label Control called OrderDescLabel

Then you do this for the Default property of OrderDescLabel:

 

 

Filter('Sales Order Tracker','Blackout Order #' = First(OrderNo_Combo.SelectedItems).Result).OrderDescription

 

 

See if it helps @lg270492 

 

 

 

Ah still not working @poweractivate 😞

 

I get the error Incompatible types for comparison. These types can't be compared: Text, Error.

 

Also this: 

lg270492_0-1665141636220.png

 

@lg270492 

 

Since it looks like you don't Distinct on the Blackout Order #, you should not use .Result

 

Try with something other than .Result - see what it autosuggests.

//pseudocode
LookUp('Sales Order Tracker','Blackout Order #' = First(OrderNo_Combo.SelectedItems).'Blackout Order #').OrderDescription

 And since only a single record should be returned, use LookUp not Filter

@lg270492 

 

First, set your Data row limit to 1 to make sure the app works with more than even the local maximum of 2000 records, from the sound of what you have, you might already need a solution that is not restricted by this limit at all if possible.

 

1. Settings

2. Change the Data row limit to 1. The default is 500, and the maximum is 2000 - but don't change it to 2000 - change it to 1

poweractivate_0-1664872234598.png

 

Once you do the above, if you see 1 record anywhere, you know you are restricted by the delegation limit - with or without the warning - and if you see all your records or more than one record, you are likely not restricted. 

 

It looks like putting the whole data source directly in the Items property of a ComboBox might trigger the delegation limit, this may be an issue for you.

 

Although a more complex solution may still be possible to try and recreate the autosuggest functionality of the ComboBox without the delegation limit, let's suppose you want a simpler solution for now.

 

if you can get away with it (or even if you prefer it better), just use a simple Text Input, not a ComboBox, and then a Button such as a "Go" button.

 

Put nothing in for the Default of the Text Input, or put this

 

""

 

 

Use this formula for OnChange of the Button

 

Set(someVar,LookUp(dataSource,blackOutOrderNumberColumn=TextInput1.Text))

 

 

For the DefaultMode property of the Form

 

FormMode.Edit

 

 

For the Item property of the Form

 

someVar

 

 

See if it helps @lg270492 

You are a genius!! Thank you so much for helping me with this! 

 

Have a great weekend!

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (1,496)