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 / Toggle Value added to ...
Power Apps
Answered

Toggle Value added to collect

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

i've got an issue where i want to use a Toggle, if true then the text is "IN", if false then text is "OUT"

 

i've set the TrueText  = "IN" and Falsetext = "OUT" the output needs to be added to a collect which is then uploaded,

 

the code to build the collect is 

 

 

Collect(collectMultiScan,
{
Direction: Toggle1.Value,
Barcode: BarcodeScanner2.Value,
Time: Now()
}
)

 

the problem i have is the toggle1.value is true or false, and ides how to change it to IN or OUT?

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Consider this:

    Collect(
     collectMultiScan,
     {
     Direction: If(
     Toggle1.Value,
     "IN",
     "OUT"
     ),
     Barcode: BarcodeScanner2.Value,
     Time: Now()
     }
    )

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    added the code i'm now just getting "out" no matter what option is selected on the toggle

  • eka24 Profile Picture
    20,925 on at

    I tested the code but it works fine.

    Where did you put the Code, also note the name of your Toggle1?

    Can you give a screen shot

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    alanwilcox_0-1612437794282.png

     

    code added to the onscan button, also name is toggle1 

     

    Collect(collectMultiScan,
    {
    Direction: If(
    Toggle1.Value,
    "IN",
    "OUT"),
    Barcode: BarcodeScanner2.Value,
    Time: Now()
    }
    )

  • eka24 Profile Picture
    20,925 on at

    I see an error on the Formula (Red), have you checked that?

    Also copy the formula and try it on OnSelect of a Button if that will work

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    error is now gone, still only showing out even is the toggle is set to in

  • eka24 Profile Picture
    20,925 on at

    Have tried the formula OnSelect of another button?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    thank you, it's now working i added a new button saved and published re-loaded on my phone and it wasn't showing the new button, so closed my session re-applied the code that you posted, saved published and then new version then got loaded correctly and worked

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 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard