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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,663)