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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Expand/Collapse button...
Power Apps
Unanswered

Expand/Collapse button won't working

(0) ShareShare
ReportReport
Posted on by 16

Hello,

 

I have a nested gallery with a list of items however I would like to input a button that expands and collapse gallery items with the following formula:

 

Onselect ->

If(IsEmpty(colCollapseExpandGroup),

 

    Collect(colCollapseExpandGroup,

        ForAll(Distinct(colProjectData,'Project'),

           {ID: LookUp(colProjectDate,'Project'=Result).ID,'Project':Result}

        )

    )

    ,

    Clear(colCollapseExpandGroup)

)

 

the error message I get is mostly ' Incompatible type, The 'ID' column in the data source you are updating expects a 'Number'Type and you are using a 'Error' type. and this is the same for the rest

 

Képernyőkép 2023-09-22 135945.png



Categories:
I have the same question (0)
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @AustineHype 

     

    In your code given, you use colProjectDate, which I suspect is just a typo. 

    Try this; it's a shorter version with a similar concept. If in case of error, please reply here

    If(IsEmpty(colCollapseExpandGroup),
     Collect(colCollapseExpandGroup,
     ForAll(Distinct(colProjectData,'Project') As X,
     {ID: X.ID,'Project':X}
     )
     )
     ,
     Clear(colCollapseExpandGroup)
    )

     

  • AustineHype Profile Picture
    16 on at

    Hi @cha_cha 

     

    Thanks for your quick reply, I have tried this formula but am unsure what I should put in the 'X' could you please advise?

  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @AustineHype 

     

    Just the provided code as it is. X pertains to ThisRecord keyword. In my provided code, it means it is the current item in the ForAll function.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard