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

Help with combo box from SharePoint List data

I've created a canvas app directly from a SharePoint list.  On the edit screen, I've changed a field from Text input to Combo box.  I need this combo box to retrieve values from a column in an entirely separate SharePoint list within the same SharePoint site.  I've already set up the additional connection.  When I added the Combo box, I used the following function for the Items property:

 

Choices([@'Unified Group Provisioning'].'Group Display Name')

 

Group Display Name is the name of a column in the Unified Group Provisioning list.

I used this because I have another Combo box from the original SharePoint list using the following function which works correctly.

 

Choices([@'Extranet User Provisioning'].US_x0020_Citizen)

 

As you can tell, the original SharePoint list is called Extranet User Provisioning, and the list that I connected after the fact is called Unified Group Provisioning.

Eventually, there will be many records in the Unified Group Provisioning list, potentially more than 500, and I know that it's best practice to use delegation so the processing and filtering happens server-side.

The immediate problem I have though is that I have an error on the function

 

Choices([@'Unified Group Provisioning'].'Group Display Name')

 

I thought this function would work since it's the same exact syntax as the other combo box that has no error.

The error is "Issue, Expected Table value, The property on this control expects Table values.  The rule produces Text values which are incompatible.

How to fix: Change the rule to produce a {0} value.

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @tgarrity ,

You do not need the Choices if this is what you want to do - you just need

[@'Unified Group Provisioning'].'Group Display Name'

You can add a sort

Sort([@'Unified Group Provisioning'].'Group Display Name',Ascending)

If you want Distinct values however the query is not Delegable

Sort(
    Distinct(
        [@'Unified Group Provisioning'],
        'Group Display Name',
    ).Result,
    Ascending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

10 REPLIES 10
WarrenBelz
Super User
Super User

Hi @tgarrity ,

Assuming 'Group Display Name' is a Choice field, are you simply missing a bracket at the end?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

Wish it was that simple, but thanks for pointing that out.  I've corrected the code in my original post, but the error stands.

@tgarrity ,

Are you confirming that 'Group Display Name' is a Choice field in the SharePoint list 'Unified Group Provisioning' and that you have this list as a data source in Power Apps? If so, Delegation is not an issue as you are simply accessing the field definition data. How many choices do you have in the definition?

 

Hi @tgarrity ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

It's not a choice field, but is a "single line of text" field in SP.  I'm trying to redefine the behavior in the power app.  So in the Power App, I'm trying to do develop the  interface of the form in Power Apps, not SharePoint.  I only used the SharePoint list as a baseline for creating the Power App.  I'm not so much concerned about delegation at the moment.  I'm just trying to get the other SP list to interface with my Power App at this moment.

@tgarrity ,

That explains the issue - you cannot have

Choices([@'Unified Group Provisioning'].'Group Display Name')

when the field is not either a Choice or a LookUp field - there are no choices to display.

You can however hard-code them

["Choice 1","Choice 2","Choice 3"]

in the Items of the control.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

I appreciate your help thus far.  However, I believe there must be a way to do this dynamically.  I can't be expected to be constantly updating a static list of 500 or more choices.  Perhaps a better way would be do query Azure AD for those SharePoint groups using a filter that has a certain prefix and use the results of the query as options for the dropdown?  Do you think that would be possible?  If you do and if you have some guiding information, it would be appreciated.

Hi @tgarrity ,

You do not need the Choices if this is what you want to do - you just need

[@'Unified Group Provisioning'].'Group Display Name'

You can add a sort

Sort([@'Unified Group Provisioning'].'Group Display Name',Ascending)

If you want Distinct values however the query is not Delegable

Sort(
    Distinct(
        [@'Unified Group Provisioning'],
        'Group Display Name',
    ).Result,
    Ascending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @tgarrity ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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.

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 (15,659)