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 / Trying to use Data Sou...
Power Apps
Answered

Trying to use Data Source to Control Button if possible?

(0) ShareShare
ReportReport
Posted on by 21

I' am trying to use the If statement to control the default property of a toggle. I feel like im close im just missing something. I'am using Microsoft List as my data source, I started with; 

 

LookUp('MANC Plant Dashboard Controls', ID=1, {Control: "1"});
Set(varReclaimToggle,true);
LookUp('MANC Plant Dashboard Controls', ID=1, {Control: "0"});
Set(varReclaimToggle,false);

 

I have then been trying to figure out how to use the "IF" statement just to read "Control value" on the ID row. So my formulas got real bizarre real fast trying to make it work.

 

If('MANC Plant Dashboard Controls', ID=1, {Control.value="1"}),
Set(varReclaimToggle,true),Set(varReclaimToggle,false);

 

My global variable is on the default property on the toggle switch, This formula I' am running off a timer so every so often it reached out to the data source to see the current status of the control value to make it either on or off. Just don't know how to correctly code what I want it to do. Any help would be appreciated. Thanks.

Categories:
I have the same question (0)
  • BigDaddy Profile Picture
    21 on at

    First picture is the list im grabbing from. The lower picture on the left is my timer end property and the lower right picture is my Default property on the toggle button.

     

    formulas.png

  • BigDaddy Profile Picture
    21 on at

    I' m trying to just change the global variable now but cant get the value from the value in the control column to change the variable;

     

    Set(varReclaimToggle,LookUp('MANC Plant Dashboard Controls', ID="1", Control))

  • Verified answer
    R Bakker Profile Picture
    725 on at

     Would this work directly in the default value of the toggle?

     

    LookUp('MANC Plant Dashboard Controls', ID=1,Control)="1"

  • Verified answer
    BigDaddy Profile Picture
    21 on at

    I was finally able to get it to work using;

     

    LookUp('MANC Plant Dashboard Controls',ID=1,Control) on the Default Property on the toggle. I just changed from using "0" and "1"s to using "true" and "false" values on the data source. I appreciate your reply though. Thanks.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard