cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dthope69
Helper I
Helper I

List box focus

Hello, I have a list box with 30 items. The listbox only shows 5. The list box default on new form to pull from another list.

 

Here's the issue: if the defaulted item in below the 5 you can't tell what's selected, so is there a way to put the selected item as top in list?

 

TYIA, you're always a great help!

5 REPLIES 5
v-xida-msft
Community Support
Community Support

Hi @dthope69,

Could you please share a bit more about your scenario?

Do you want to put the selected item as Top when you select an item within the List box?

Based on the needs that you mentioned, I think there is direct way to achieve your needs in PowerApps currently.

As an alternative solution, I have made a test on my side, please take a try with the following workaround:10.JPG

 

9.JPG

Set the OnVisible property of the Edit screen which contains the Edit form to following:

ClearCollect(
ListBoxItems,
Filter('20181019_case9_Courses', ID = 15),
Filter('20181019_case9_Courses', ID <> 15)
)

On your side, you should type:

ClearCollect(
ListBoxItems,
Filter('YourAnotherSPList', ReferencedColumn = Gallery.Selected.RelatedColumn),
Filter('YourAnotherSPlist', ReferencedColumn <> Gallery.Selected.RelatedColumn)
)

Note: The ReferencedColumn represents the column name in your 'YourAnotherSPList', which you displayed within the ListBox control. The RelatedColumn represents the column name within the data source which your current Edit form connects to. The RelatedColumn used to store the selected value within the List Box. The Gallery  (Gallery1) connects to same data source within your Edit form.

Set the Items property of the List Box control to following:

If(
    EditForm1.Mode=FormMode.New,
    '20181019_case9_Courses'.ID,
    ListBoxItems.ID
)

On your side, you should type:

If(
    EditForm1.Mode = FormMode.New,
    'YourAnotherSPList'.ReferencedColumn,
    ListBoxItems.ReferencedColumn
)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply, I haven't had a chance to test this yet. Hopefully this weekend...

Hello,

 

Quality Observations (SP List) is the Items in ListBox .

UserPreferences is the SP list I am retrieving data from in "Default" property of Listbox.

Project is the field in both lists. Looks up UserPreferences.Project from current user's email, which is "title" in UserPreferences list.

 

So in example attached it should have Asia Pacific in top line of List box, or at least scroll to it. As it is now if defaults to something past the 1st 10 rows or so you don't know it until you scroll down.

 

For reference, also attached-

 

Edit screen (scrHome) OnVisible-

ClearCollect(
ListBoxItems,
Filter('Quality Observations', Project = LookUp(UserPreferences,Title=User().Email).Project.Value),
Filter('Quality Observations', Project <> LookUp(UserPreferences,Title=User().Email).Project.Value)
)

 

Items of List box (lstProjects)-

 If(

    frmQO.Mode = FormMode.New,

    'Quality Observations'.Project,

    ListBoxItems.Project

)

 

 

 

 

Hi @dthope69 ,

Is the Project column a LookUp column or Choice type column in your SP list?

Based on the formula that you mentioned, I think there is something wrong with it. Please consider take a try to modify your formula as below:

Edit screen (scrHome) OnVisible:

ClearCollect(
             ListBoxItems,
             Filter('Quality Observations', Project.Value = LookUp(UserPreferences,Title=User().Email).Project.Value), /* <-- Please type Project.Value instead of Peoject */
             Filter('Quality Observations', Project.Value <> LookUp(UserPreferences,Title=User().Email).Project.Value)
)

Items of List box (lstProjects):

 If(
    frmQO.Mode = FormMode.New,
    'Quality Observations'.Project,
    ListBoxItems.Project
)

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

It is a lookup in another SP list so I believe the collection will need the ID and Value...

 

I tried this but I don't quite understand these Lookups and filters with SP lists yet...

 

ClearCollect(
             ListBoxItems,
             Filter('Quality Observations', Project.Value = ForAll(Project:{ 
'@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", 
Id: LookUp(UserPreferences,Title=User().Email).Id.Value, 
Value: LookUp(UserPreferences,Title=User().Email).Project.Value
})
,
Filter('Quality Observations', Project.Value <> ForAll(Project:{ 
'@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", 
Id: LookUp(UserPreferences,Title=User().Email).Id.Value, 
Value: LookUp(UserPreferences,Title=User().Email).Project.Value
}))
)

 

Thanks,

Paul

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,512)