cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Super User
Super User

Save Custom toggle button text value to SharePoint list

Dear All,

I am developing a canvas app for a hospital record. I have set some toggle button.

Example:

Surgery (Yes / No)

Eyes(Normal / Abnormal) 

When i click the slider on Toggle button, the text value must be save into SharePoint list (instead of On/Off, True/False)

 

How can i achieve this. Please help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @venka91 :

Could you tell me:

  • Do you want to update specific text to the SharePoint List based on the value of Toggle?
  • What is the target column?Is it a Single Line Of Text column?

If so, you only need to replace the uploaded value from 

ToggleName.Value

to

If(Togglename.Value,"Textl","Text2")

For example:

I assume that the original submit formula is

Patch(YourSPList,Default(YourSPList),{Title:"Title",Eyes:Toggle1.Value})

and now it should be

Patch(YourSPList,Default(YourSPList),{Title:"Title",Eyes:If(Toggle1.Value,"Normal","Abnormal")})

In addition,If you are using a Form control, just replace the Update property of the specified DataCard with 

If(Togglename.Value,"Textl","Text2")

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @venka91 :

Could you tell me:

  • Do you want to update specific text to the SharePoint List based on the value of Toggle?
  • What is the target column?Is it a Single Line Of Text column?

If so, you only need to replace the uploaded value from 

ToggleName.Value

to

If(Togglename.Value,"Textl","Text2")

For example:

I assume that the original submit formula is

Patch(YourSPList,Default(YourSPList),{Title:"Title",Eyes:Toggle1.Value})

and now it should be

Patch(YourSPList,Default(YourSPList),{Title:"Title",Eyes:If(Toggle1.Value,"Normal","Abnormal")})

In addition,If you are using a Form control, just replace the Update property of the specified DataCard with 

If(Togglename.Value,"Textl","Text2")

Best Regards,

Bof

venka91
Super User
Super User

Thanks. This worked perfectly.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,178)