web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Toggle button problems...
Power Apps
Unanswered

Toggle button problems - patch table with custom value

(0) ShareShare
ReportReport
Posted on by

Hi,

i'm pretty new in this area (powerapps and programming) so i would need a little bit of help with toggle setup.

I have a table called "RDU", rows are marked with "ID_DS", with "problematic" columns  called "Value_A" to "Value_D". Possible values are "0" and "1", with default value "0".

I changed drop-down menu with toggle button (in edit form), since it's more user friendly to just "tap" the option where you want to have value "1", as to select it form drop down menu.

Here comes the problem. I don't know how to save selected option to my table (RDU).

I managed to set toggle buttons to display existing value in table with

 

If(LookUp('RDU',ID_DS=BrowseGallery1.Selected.ID_DS, Value_A.Value)="1",true)

 

under Default value of toggle button.

Now i don't know how to patch my table with either "0" or "1" value, based on toggle status.

I tried with patch

 

Patch('RDU',LookUp('RDU',ID_DS=ThisItem.ID_DS,{Value_A: "1"})

 

under OnCheck (and OnUncheck for "0") field, but to na avail. I get "The type of this argument does not match type 'Record'. Expected. Found type 'Text'."

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @Anonymous ,

     

    Could you please share more details about your scenario? Which data source are you working with? Which field types are the "problematic" columns?

     

    Based on your description, you replaced the default ComboBox with a Toggle, but you need to know the difference between this two controls. A Dropdown Box contains several records of choices which means you select a value that is a line of record, while a Toggle contains two values of True and false, also you could retrieve TrueText of FalseText of the Toggle but all of the values are Boolean type or Text type but not a record.

     

    Then the problem is how to patch a choice column with a record, right? You could modify the Patch formula into:

     

    Patch('RDU',LookUp('RDU',ID_DS=ThisItem.ID_DS),{Value_A:LookUp(Choices('RDU'.Value_A ),Value="1")})

     

    In the Value_A column, to look up a single field record value which is "1" to update.

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution  to help the other members find it.
  • Community Power Platform Member Profile Picture
    on at

    Hi,

    thank you @v-jefferni for your answer.

    I guess my information was a bit scarce, but i'm not that familiar with either SharePoint or programming.

    My source is SharePoint list.

    Patch formula syntax is OK - i guess it works, but i can't try it. I guess problem now is default value of toggle button. It's set to look for current value of Value_A(to B) field.

     

     

    If(LookUp('RDU',ID_DS=BrowseGallery1.Selected.ID_DS, Value_A.Value)="1",true)

     

     

    But all i get now, after i inserted your patch formula, is that whenever i try to toggle button form false to true or vice versa it get's reset back to value from table.

    As i mentioned before, there are 5 fields (choice field with dropdown menu) named Value_A to Value_D in SP list ('RDU') with value either "0" or "1" (let's say grades) . Default value is "0".

    In my app you get a preview list (gallery) of subjects (records from RDU table)  with those five grades. When you select record you are taken on a next screen (edit screen) where you can change grades (0 or 1) for for all 5 categories of that record.

    Once you select them, you can click either "Save & return" button (submits form) or "Cancel & return" (resets form and returns back to preview).

    Solution with drop down menu worked fine, also with radio button, which is also a bit friendlier option for user (less clicks), but ideal solution would be toggle button - a bit more visual than radio button.

    Long story short, my problem is:

    1. Getting toggle button to display current value of field (either "0" or "1") from list
    2. Option for user to change that value
    3. Possibility to save that choice to list

    Thank you again for your time!

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard