web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collect function isnt ...
Power Apps
Suggested Answer

Collect function isnt working anymore

(1) ShareShare
ReportReport
Posted on by 1,362
Hello, I have multiple columns where they are set as a Choice data type and are multi-select.

For some reason, this particular field in Power Apps is causing an issue.
I have tried to remove the field from both the list and the app, re-add the field in SharePoint, reload the app, and set the collection as I did the others.
Everything works except for when I attempt to add the following to the forms OnVisible property.
 
 
The error states "Name isn't valid. 'ACHOrigHighRiskSECCodes' isn't recognized"
When I enter the period after Selected I only see the check box name and Value as choices, not the list of field names.

Any ideas?
Categories:
  • ronaldwalcott Profile Picture
    3,914 Moderator on at
    Show the definition of the column.
    You are using Collect here, Was the collection already initialized so it is already defined somewhere else?
  • golfnutt82 Profile Picture
    1,362 on at
    Column definition from SharePoint
  • ronaldwalcott Profile Picture
    3,914 Moderator on at
    Sorry, is gaLACHOrigHRSC the gallery item? The others are using a different gallery. Does the form have two galleries? If so, what is the relationship?
  • Suggested answer
    cha_cha Profile Picture
    4,932 Moderator on at
    Hello  golfnutt82,
     
    Various ways to troubleshoot here.
    Column name in SharePoint
    • Though you mentioned already that the name is right, double check in the URL. Normally Power Apps use this as the way to refer the column. 
    Column name in App
    • First looks like the column name is not recognize.
    • Double check the Items property of galACHOrigHRSC as the column name for 'ACHOrigHighRiskSECCodes' might have been renamed.
    Weird bug
    • Reload the app. Sometimes you have just been developing for awhile that some cache are not cleared.
  • golfnutt82 Profile Picture
    1,362 on at
     
    I deleted the field from Power Apps.
    I deleted the field from SharePoint.
    I added a new multi-select choice field called "ACHOrigHRSC" to SharePoint with the same choices.
    I added the new field to my Power Apps form
    Added a new blank vertical gallery like I did many times before
    Connected the gallery to the list and field
    Changed the text property of the checkbox to ThisItem.Value
    OnCheck Property is set to Collect(colACHOrigHRSC,ThisItem.Value)
    OnUnCheck Property is set to RemoveIF(colACHOrigHRSC,Value=ThisItem.Value)
    Set the Default Property of the checkbox to ThisItem.Value in colACHOrigHRSC.Value
    Set the Default Property of the DataCard to colACHOrigHRSC
    Set the Update Property of the DataCard to colACHOrigHRSC
     
    I have done this same thing so many times without an issue until now.
    Everything functions as it should until I enter the logic I showed in my original post.
    I still get the error, even though I started over and changed the name.
    I am totally at a loss.

    Thanks for helping out.
    Its always good to have an extra set of eyes.

     
  • Suggested answer
    ronaldwalcott Profile Picture
    3,914 Moderator on at
    Should probably be .Value the way you are doing it

    Changed my mind as it is a multiple selection.

    Use the gallery.selected the same as the other fields and it will collect all the selected options.
    The question then becomes how you plan to manage the collection
  • ronaldwalcott Profile Picture
    3,914 Moderator on at
    Forgot to mention 
    gaLACHOrigHRSC is not a gallery it is the list of checkboxes. Although it is expressed as a table the column name used by this table is Value not ACHOrigHighRiskSECCodes.
     
  • golfnutt82 Profile Picture
    1,362 on at
    Yes, I have multiple galleries that all do the same thing with multi-select checkboxes.
    Each gallery is unique and each gallery has a different collection name and they all write to the SharePoint item when the patch runs.
  • ronaldwalcott Profile Picture
    3,914 Moderator on at
    Not sure what you mean but this is not a gallery 
     
  • golfnutt82 Profile Picture
    1,362 on at
    Actually, it is a blank vertical gallery, and I added a checkbox input to the gallery and then connected the item's property to the gallery.
    In the text property of the Checkbox control, I entered ThisItem.Value and then the checkboxes showed the values that came from the SharePoint multi-select field.
    You say I am not using a gallery, why?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard