cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
duncooke
Frequent Visitor

Collection not retrieving data from SharePoint list

Good day all

 

I am having an annoying issue with a PowerApp.  I have basic SharePoint list with a column called Topic (Choice with a number of choices available for selection).  The collection in the app should collect all the topics and then display them without duplicates - I am building an FAQ accordion so the topics will each contain a number of question so topics should only display once.

 

I have the following formula set on the App OnStart property:

ClearCollect(colTopics,RenameColumns(Distinct(FAQs,Topic),"Result","Topic"));Set(glbTotalTopics,CountRows(colTopics))

 

 

When I check Collections to check if it is working, I see the following:

colTopics.png

 

so the results header is correctly adjusted to Topic as per the formula but I do not understand why I am not getting any results - there are a total of 4 distinct Topics in the list. 

 

Any help on this would be greatly appreciated! This is from the FAQ accordion solution Jamie Willis-Rose presented at Global Con 4 so if anyone has reproduced that successfully and can share how they got this part working, it would be great to know.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @duncooke ,

Try this (it worked for me)

Set(
    gblTotalTopics,
    CountRows(
        Distinct(
            FAQs,
            Topic
        )
    )
)

 

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

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @duncooke ,

Try this (it worked for me)

Set(
    gblTotalTopics,
    CountRows(
        Distinct(
            FAQs,
            Topic
        )
    )
)

 

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.

Hey WarrenBelz

 

Thanks for the reply.  When I opened the app this morning to try the solution, it was working.  So it seems that I just should have waited a few hours instead of rebuilding the app 7 times!  Is it odd to have to wait for a function like this to start working?  I will test your solution in another app later to check if it works better.

 

Thanks again!

Thanks @duncooke ,

It should work - it is simply a more compact version that uses a lot less system overhead than making a collection and then dissecting that.

 

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,999)