cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dthope69
Level: Powered On

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
Community Support Team
Community Support Team

Re: List box focus

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.
dthope69
Level: Powered On

Re: List box focus

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

dthope69
Level: Powered On

Re: List box focus

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

)

 

 

 

 

Community Support Team
Community Support Team

Re: List box focus

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.
dthope69
Level: Powered On

Re: List box focus

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 303 members 4,523 guests
Please welcome our newest community members: