Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Change Collection Value (Wert) to "true" after Button Click

(0) ShareShare
ReportReport
Posted on by 39

Hey Community,
i don't know, how i change every column of my collection after button click.

This is my following Collection. 

 

ClearCollect(
 colAusprägungsWert
 , {Wert: "1", Completed: false}
 , {Wert: "2", Completed: false}
 , {Wert: "3", Completed: false}
 , {Wert: "4", Completed: false}
 , {Wert: "5", Completed: false}
 , {Wert: "6", Completed: false}
 , {Wert: "7", Completed: false}
 , {Wert: "8", Completed: false}
 , {Wert: "9", Completed: false}
 , {Wert: "10", Completed: false}
);

 

 I want to change "Completed" to true, after Button click.

 

Patch(
 colAusprägungsWert,
 First(colAusprägungsWert),
 {Completed: true}
)

 

 This is my Navigation, where i want that the rectangles are filled after Button click.

Marczii007_0-1703079027531.png

 

Please help me out, with the OnSelect Statement.
Thanks!

 

  • CNT Profile Picture
    CNT 10,919 on at
    Re: Change Collection Value (Wert) to "true" after Button Click

    @Marczii007 

    Glad to help!

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Marczii007 Profile Picture
    Marczii007 39 on at
    Re: Change Collection Value (Wert) to "true" after Button Click

    Thanks it worked!

  • Verified answer
    CNT Profile Picture
    CNT 10,919 on at
    Re: Change Collection Value (Wert) to "true" after Button Click

    @Marczii007 Set a variable in the OnStart,

    Set(varCounter, 0)

    Then use this formula,

    Set(varCounter, varCounter+1);
    Patch(
     colAusprägungsWert, Index(colAusprägungsWert, varCounter),
     {Completed: true}
    )

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Marczii007 Profile Picture
    Marczii007 39 on at
    Re: Change Collection Value (Wert) to "true" after Button Click

    Thanks for the response. Sorry for my description.

    I need the following:  if i click on ">", the first Column Value set to "Completed: true". If i click again on ">" the second column is set to "Completed: true", what means the second rectangle is filled.

    I don't need to have all filled after button click 🙂


  • BCLS776 Profile Picture
    BCLS776 8,988 on at
    Re: Change Collection Value (Wert) to "true" after Button Click

     If you need to change them all with a single click, try this in the OnSelect of a button:

    ForAll(colAusprägungsWert As aRec,
     Patch(
     colAusprägungsWert,
     aRec,
     {Completed: true}
     )
    )

    Hope that helps,

    Bryan

  • CNT Profile Picture
    CNT 10,919 on at
    Re: Change Collection Value (Wert) to "true" after Button Click

    @Marczii007 

    Please try the following,

    UpdateIf(
     colAusprägungsWert,
     true,
     {Completed: true}
    )

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard