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 / Powerapps Filter a Col...
Power Apps
Answered

Powerapps Filter a Collection and add columns based on a IF statment of 15 boolean choices (or choice columns)

(0) ShareShare
ReportReport
Posted on by 301

Hi,

 

I have a canvas app (completely offline) that the users after answering 15 questions (toggles) if the user selects a no to one of the answers the user will need to take a photo (on another screen in a gallery)

The Onselect button that will patch them if the answers are true but if

One or more of the questions answers are false then the onselect will collect the column name that is false to a new collection called colPrestartImageCollection and add three columns GalImage GalImageURL and GalImageDetails to that collection

and then on the next screen the gallery will display all the items that need a photo taken, however i just cant figure out the code


 

 

ClearCollect(
 colPrestartImageInspection,
 AddColumns(
 Filter(
 colPrestartImageGallery,
 Brakes = tbrakes.false,
 Steering = tsteering.false
 etc etc
 ),
ClearCollect(
 colPrestartImageInspection,
 "GalImageURL",
 "GalImageDetails",
 "GalImage"
);

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,374 Most Valuable Professional on at

    Hi @ShaneITAutomate ,

    As below, but you also need to say what is in the columns - not sure on the last one, but try it.

    ClearCollect(
     colPrestartImageInspection,
     AddColumns(
     Filter(
     colPrestartImageGallery,
     Brakes = tbrakes.false,
     Steering = tsteering.false
     etc etc
     ),
     "GalImageURL",Blank(),
     "GalImageDetails",Blank(),
     "GalImage",Blank()
     )
    )

     

    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.

  • ShaneITAutomate Profile Picture
    301 on at

    @WarrenBelz wrote:

    Hi @ShaneITAutomate ,

    As below, but you also need to say what is in the columns - not sure on the last one, but try it.

     

    ClearCollect(
     colPrestartImageInspection,
     AddColumns(
     Filter(
     colPrestartImageGallery,
     Brakes = tbrakes.false,
     Steering = tsteering.false
     etc etc
     ),
     "GalImageURL",Blank(),
     "GalImageDetails",Blank(),
     "GalImage",Blank()
     )
    )

     

     

    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 warren thanks again for your help.

    I dont think i explained it very well ill use some images and try to redefine my issue

    appscreen.png

     

    Here on my first screen (its the question screen, its also a canvas with no forms)

    i want the user to go through and select all the toggles, if one of the answers is no and the toggle is false, i wish to collect the name of the item and that the defect is false and add the three columns so that

     

    appscreen2.png

    on this screen the user can see on this gallery the items name and click on it be taken to another screen to take a picture for each false answer

     

    if i use the code below i get several errors such as invalid number of arguments

    this predicte is a literal value and name isnt recogonised



    @WarrenBelz wrote:

    Hi @ShaneITAutomate ,

    As below, but you also need to say what is in the columns - not sure on the last one, but try it.

     

    ClearCollect(
     colPrestartImageInspection,
     AddColumns(
     Filter(
     colPrestartImageGallery,
     Brakes = tbrakes.false,
     Steering = tsteering.false
     etc etc
     ),
     "GalImageURL",Blank(),
     "GalImageDetails",Blank(),
     "GalImage",Blank()
     )
    )

     

     

    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.


     

    if i use the code below i get no errors however i dont get the name of the column (plus its not collecting the three columns for each non compliant ?

    fyi (im using toggles to switch a dropdown because of the choice column of the datasource)

     

     

    ClearCollect(
     colPrestartImageInspection,
     AddColumns(
     Filter(
     colLVPrestartInspection,
     copybrakes.Selected.Value = "Non Compliant";
     copysteer.Selected.Value = "Non Compliant";
     copyseat.Selected.Value = "Non Compliant";
     copytyres.Selected.Value = "Non Compliant"
     ),
     "GalImageType","",
     "GalImageURL","",
     "GalImageDetails","",
     "GalImage",""
    ))

     

     

     

  • WarrenBelz Profile Picture
    155,374 Most Valuable Professional on at

    @ShaneITAutomate ,

    Please do not re-post code given as it only makes your post harder to read.

    The syntax I have on the AddColumns is correct and adds three blank columns - the rest of the code is copied from what you posted.

    Can you please post in Text the exact code you have attempted and also confirm that you want this done if any of the answers are no.

  • Verified answer
    ShaneITAutomate Profile Picture
    301 on at

    @WarrenBelz wrote:

    @ShaneITAutomate ,

    Please do not re-post code given as it only makes your post harder to read.

    The syntax I have on the AddColumns is correct and adds three blank columns - the rest of the code is copied from what you posted.

    Can you please post in Text the exact code you have attempted and also confirm that you want this done if any of the answers are no.


    ill ask a new question, it will be clearer in the new one. cheers

  • WarrenBelz Profile Picture
    155,374 Most Valuable Professional on at

    @ShaneITAutomate ,

    I see your other post seems to be less clear to the responder.

    I will close this one - tag me if you want my assistance otherwise I will move onto to something else I hope I am better equipped to handle.

  • ShaneITAutomate Profile Picture
    301 on at

    @WarrenBelz wrote:

    @ShaneITAutomate ,

    I see your other post seems to be less clear to the responder.

    I will close this one - tag me if you want my assistance otherwise I will move onto to something else I hope I am better equipped to handle.


    Will do,

     

    Thanks again i think i jumped the gun on what i was trying to achieve.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard