Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Onselect executing multiple commands

(0) ShareShare
ReportReport
Posted on by 8

Hi,

 

I am very new to PowerApps and I have been struggling with an issue. I have tried reading forum posts and asking chatGTP, however I still run in to the same issue. I have written this code in the Onselect field for a button:

 

Collect(colProducts;{ Name: txt_itemName.Text; Price: txt_productPrice.Text})

 

I want the button to do several things at the same time when I press it, however I get an error message when I either try to use ";" or "," after the command I have already written to chain together multiple commands. The error message says it is an "unexpected sign". 

 

Some help is greatly appriciated. Thank you 🙂

Categories:
  • Addieeg Profile Picture
    Addieeg 8 on at
    Re: Onselect executing multiple commands

    Wow thank you so much! The double semicolon worked. My professor only uses one semicolon and that worked for him, so that really confused me...

  • Verified answer
    iAm_ManCat Profile Picture
    iAm_ManCat 18,151 on at
    Re: Onselect executing multiple commands

    ChatGPT is not a great source for Power Apps to be honest

     

    In your example, if your locale means that you use ; to separate parameters like in the code you provided, then you will use ;; to separate actions, like this:

    Collect(colProducts;{ Name: txt_itemName.Text; Price: txt_productPrice.Text});;
    Collect(colProducts;{ Name: txt_itemName2.Text; Price: txt_productPrice2.Text})

    if your code normally uses comma , to separate parameters, then you would use ; like this:

    Collect(colProducts,{ Name: txt_itemName.Text, Price: txt_productPrice.Text});
    Collect(colProducts,{ Name: txt_itemName2.Text, Price: txt_productPrice2.Text})

     

    Cheers,

    Sancho

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,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard