Modify Interaction with Lookup Field

%3CLINGO-SUB%20id%3D%22lingo-sub-1265859%22%20slang%3D%22en-US%22%3EModify%20Interaction%20with%20Lookup%20Field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1265859%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20in%20the%20midst%20of%20creating%20a%20form%20that%20needs%20to%20access%20a%20separate%20list%20of%20~3K%20records.%20It%20is%20a%20list%20of%20accounts.%20I%20have%20the%20form%20created%2C%20and%20the%20look%20up%20field%20is%20working.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20allowing%20typing%20into%20the%20field%20instead%20of%20the%20pop%20up%20menu.%20The%20pop%20up%20menu%20of%203K%20accounts%20numbers%20is%20not%20very%20handy.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1299415%22%20slang%3D%22en-US%22%3ERe%3A%20Modify%20Interaction%20with%20Lookup%20Field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1299415%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F601563%22%20target%3D%22_blank%22%3E%40SalesmanGil%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20you%20tried%20editing%20in%20datasheet%20view%3F%3C%2FP%3E%3CP%3EI%20apologize%20if%20I%20misunderstood%20what%20you%20are%20asking.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1299834%22%20slang%3D%22en-US%22%3ERe%3A%20Modify%20Interaction%20with%20Lookup%20Field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1299834%22%20slang%3D%22en-US%22%3EI%20haven't%2C%20what%20a%20great%20simplistic%20approach.%20I%20will%20give%20it%20a%20try.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1300918%22%20slang%3D%22en-US%22%3ERe%3A%20Modify%20Interaction%20with%20Lookup%20Field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1300918%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F601563%22%20target%3D%22_blank%22%3E%40SalesmanGil%3C%2FA%3E%26nbsp%3Bif%20you%20are%20using%20a%20modern%20SharePoint%20Online%20list%20then%20what%20you%20want%20to%20do%20can%20be%20achieved%20quite%20easily%20with%20a%20customised%20Power%20Apps%20form.%20And%20the%20result%20will%20look%20better%20than%20a%20standard%20SharePoint%20form.%20In%20my%20example%20I'm%20going%20to%20add%20a%20new%20airport%20and%20its%20information%20to%20my%20list%2C%20looking%20up%20the%20airport%20name%20from%20a%20list%20of%20over%203000%20airports%20in%20Oceania%2C%20selecting%20it%20by%20typing%20the%20first%20few%20letters%20of%20the%20name.%20%3CSTRONG%3EEdit%3A%20see%20the%20attached%20video%20which%20goes%20through%20the%20steps%20detailed%20below.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20So%20first%20we%20have%20the%20lookup%20list%20with%20which%20only%20has%20the%20Title%20column%20containing%20the%20name%20of%20each%20airport.%20I've%20named%20this%20list%20AirportLU%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221-SP-AirportLU.png%22%20style%3D%22width%3A%20295px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183774i6F26931685D77AF1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221-SP-AirportLU.png%22%20alt%3D%221-SP-AirportLU.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20We%20also%20have%20our%20main%20list%20where%20we%20are%20saving%20the%20data.%26nbsp%3BFrom%20the%20PowerApps%20menu%20in%20the%20main%26nbsp%3B%20list%20select%20Customize%20forms.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%222-SP-Airports.png%22%20style%3D%22width%3A%20984px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183775i9FA98A93EFECBB70%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222-SP-Airports.png%22%20alt%3D%222-SP-Airports.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3.%20The%20form%20will%20be%20created%20and%20several%20(though%20not%20always%20all)%20columns%20will%20have%20been%20added.%20With%20the%20form%20selected%20you%20can%20add%20in%20any%20missing%20columns.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%223-editFields.png%22%20style%3D%22width%3A%20696px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183779iCC1DDA42321495EE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223-editFields.png%22%20alt%3D%223-editFields.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E4.%20From%20the%20rail%20on%20the%20far%20left%20select%20the%20data%20sources%20icon%2C%20enter%20SharePoint%20and%20select%20your%20site%20and%20the%20lookup%20list%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224-dataSource-Lookup.png%22%20style%3D%22width%3A%20359px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183782i7348848C703713F8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224-dataSource-Lookup.png%22%20alt%3D%224-dataSource-Lookup.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E5.%20On%20my%20form%20I've%20added%20a%20label%20to%20show%20the%20display%20mode%20of%20the%20form.%20I've%20named%20it%20%3CSTRONG%3ElblMode%3C%2FSTRONG%3E%20and%20the%20%3CEM%3EText%3C%2FEM%3E%20property%20has%20been%20set%20as%20follows%3A%3CBR%20%2F%3E%3CSTRONG%3EIf(SharePointForm1.Mode%3DFormMode.Edit%2C%22Edit%20Airport%22%2C%20%22New%20Airport%22)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%225-modeLabel.png%22%20style%3D%22width%3A%20792px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183784i27AE05F6BC295943%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%225-modeLabel.png%22%20alt%3D%225-modeLabel.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E6.%20Next%20add%20a%20text%20input%20control%20which%20is%20where%20you%20will%20enter%20the%20first%20few%20letters%20of%26nbsp%3B%20the%20airport%20name%20(or%20client%20name%20in%20your%20case).%20I've%20named%20this%20%3CSTRONG%3EinpAirport%3C%2FSTRONG%3E.%20We%20only%20want%20to%20show%20the%20text%20input%20control%20if%20it's%20a%20new%20airport%20so%20set%20the%20%3CEM%3EVisible%3C%2FEM%3E%20property%20to%3A%3CBR%20%2F%3E%3CSTRONG%3EIf(lblMode.Text%3D%22Edit%20Airport%22%2Cfalse%2C%20true)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%226-textInput.png%22%20style%3D%22width%3A%20726px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183785iD7BEDF89CAB4C818%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%226-textInput.png%22%20alt%3D%226-textInput.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E7.%20Next%2C%20make%20the%20Title%20data%20card%20larger%20so%20it%20can%20contain%20a%20few%20of%20the%20airports%20being%20looked%20up.%20Inside%20it%20add%20a%20vertical%20gallery%20and%20for%20its%20data%20source%20select%20the%20lookup%20list.%3C%2FP%3E%3CUL%3E%3CLI%3EFor%20the%20%3CEM%3EItems%3C%2FEM%3E%20property%20enter%26nbsp%3B%3CSTRONG%3EFilter(AirportLU%2CStartsWith(Title%2C%20inpAirport.Text))%3C%2FSTRONG%3E%26nbsp%3B-%20so%20the%20lookup%20list%20will%20be%20filtered%20to%20show%20only%20the%20items%20where%20the%20Title%20column%20starts%20with%20the%20text%20entered%20in%20the%20inpAirport%20field.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%227-gallery.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183786i4F4E9D847BBCAC54%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%227-gallery.png%22%20alt%3D%227-gallery.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3ESet%20the%20%3CEM%3EVisible%3C%2FEM%3E%20property%20the%20same%20as%20for%20the%20inpAirport%20field%20as%2C%20again%20we%20don't%20want%20to%20display%20the%20lookup%20gallery%20if%20we%20are%20editing%20an%20item%20already%20in%20the%20main%20list%3A%3CBR%20%2F%3E%3CSTRONG%3EIf(lblMode.Text%3D%22Edit%20Airport%22%2Cfalse%2C%20true)%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3EIf%20the%20item%20is%20being%20edited%20not%20only%20do%20we%20not%20want%20the%20inpAirport%20field%20and%20the%20gallery%20to%20be%20visible%20but%20we%20don't%20want%20the%20large%20amount%20of%20white%20space%20they%20have%20left%20behind%2C%20so%20set%20the%20%3CEM%3EHeight%3C%2FEM%3E%20property%3A%3CBR%20%2F%3E%3CSTRONG%3EIf(lblMode.Text%3D%22Edit%20Airport%22%2C155%2C%20317)%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3EWe%20want%20to%20get%20the%20item%20that%20is%20selected%20from%20the%20gallery%2C%20so%20for%20the%20OnSelect%20property%20enter%3CBR%20%2F%3E%3CSTRONG%3ESet(SelectedAirport%2CTitle2.Text)%3C%2FSTRONG%3E%3CBR%20%2F%3Ewhich%20will%20create%20a%20variable%20called%20Selected%20Airport%20from%20the%20Title%20of%20the%20selected%20item.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E8.%26nbsp%3B%20Click%20on%20the%20Title%20data%20field%20and%20for%20the%20%3CEM%3EDefault%3C%2FEM%3E%20property%20enter%3A%3CBR%20%2F%3E%3CSTRONG%3EIf(lblMode.Text%3D%22Edit%20Airport%22%2CParent.Default%2C%20SelectedAirport)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Eso%20that%20if%20the%20lblMode%20text%20is%20%22Edit%20Airport%22%20it%20will%20use%20the%20default%20value%20from%20the%20parent%20card%2C%20which%20is%20the%20name%20of%20the%20item%20currently%20being%20edited.%20But%20if%20the%20lblMode%20text%20is%20%22New%20Airport%22%20it%20will%20add%20in%20the%20value%20saved%20in%20the%20SelectedAirport%20variable.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%228-Title.png%22%20style%3D%22width%3A%20838px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183787i696838BF04FE4CDB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%228-Title.png%22%20alt%3D%228-Title.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESave%20and%20publish%20your%20form.%20It%20will%20now%20be%20used%20instead%20of%20the%20default%20SharePoint%20form.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20when%20you%20create%20a%20new%20item%20in%20the%20list%20and%20start%20entering%20a%20few%20letters%20into%20the%20input%20field%20the%20gallery%20will%20be%20filtered%20to%20only%20show%20those%20items%20starting%20with%20the%20letters%20you%20typed.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22StartWith.gif%22%20style%3D%22width%3A%20600px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183789i1BC6A434E242FD31%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22StartWith.gif%22%20alt%3D%22StartWith.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20took%20far%20longer%20to%20write%20out%20the%20steps%20than%20to%20actually%20build%20it!%20Do%20come%20back%20with%20any%20questions%20or%20if%20you%20need%20further%20assistance%20with%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23333399%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I'm in the midst of creating a form that needs to access a separate list of ~3K records. It is a list of accounts. I have the form created, and the look up field is working. 

 

Is there a way to allowing typing into the field instead of the pop up menu. The pop up menu of 3K accounts numbers is not very handy. 

 

3 Replies

Hello @SalesmanGil 

 

Have you tried editing in datasheet view?

I apologize if I misunderstood what you are asking.

I haven't, what a great simplistic approach. I will give it a try.

@SalesmanGil if you are using a modern SharePoint Online list then what you want to do can be achieved quite easily with a customised Power Apps form. And the result will look better than a standard SharePoint form. In my example I'm going to add a new airport and its information to my list, looking up the airport name from a list of over 3000 airports in Oceania, selecting it by typing the first few letters of the name. Edit: see the attached video which goes through the steps detailed below.

 

1. So first we have the lookup list with which only has the Title column containing the name of each airport. I've named this list AirportLU:

1-SP-AirportLU.png

 

2. We also have our main list where we are saving the data. From the PowerApps menu in the main  list select Customize forms.

2-SP-Airports.png

 

3. The form will be created and several (though not always all) columns will have been added. With the form selected you can add in any missing columns. 

3-editFields.png

 

4. From the rail on the far left select the data sources icon, enter SharePoint and select your site and the lookup list:

4-dataSource-Lookup.png

 

5. On my form I've added a label to show the display mode of the form. I've named it lblMode and the Text property has been set as follows:
If(SharePointForm1.Mode=FormMode.Edit,"Edit Airport", "New Airport")

5-modeLabel.png

 

6. Next add a text input control which is where you will enter the first few letters of  the airport name (or client name in your case). I've named this inpAirport. We only want to show the text input control if it's a new airport so set the Visible property to:
If(lblMode.Text="Edit Airport",false, true)

6-textInput.png

 

7. Next, make the Title data card larger so it can contain a few of the airports being looked up. Inside it add a vertical gallery and for its data source select the lookup list.

  • For the Items property enter Filter(AirportLU,StartsWith(Title, inpAirport.Text)) - so the lookup list will be filtered to show only the items where the Title column starts with the text entered in the inpAirport field.

    7-gallery.png

     

    Set the Visible property the same as for the inpAirport field as, again we don't want to display the lookup gallery if we are editing an item already in the main list:
    If(lblMode.Text="Edit Airport",false, true)
  • If the item is being edited not only do we not want the inpAirport field and the gallery to be visible but we don't want the large amount of white space they have left behind, so set the Height property:
    If(lblMode.Text="Edit Airport",155, 317)
  • We want to get the item that is selected from the gallery, so for the OnSelect property enter
    Set(SelectedAirport,Title2.Text)
    which will create a variable called Selected Airport from the Title of the selected item.

8.  Click on the Title data field and for the Default property enter:
If(lblMode.Text="Edit Airport",Parent.Default, SelectedAirport)

so that if the lblMode text is "Edit Airport" it will use the default value from the parent card, which is the name of the item currently being edited. But if the lblMode text is "New Airport" it will add in the value saved in the SelectedAirport variable.

8-Title.png

 

Save and publish your form. It will now be used instead of the default SharePoint form.

 

So when you create a new item in the list and start entering a few letters into the input field the gallery will be filtered to only show those items starting with the letters you typed.

StartWith.gif

 

It took far longer to write out the steps than to actually build it! Do come back with any questions or if you need further assistance with this.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User