cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yoursnani
Helper IV
Helper IV

OnSelect of button Yes/No update

Hi 

 

I am customizing SharePoint . I have YES or No column . and I want to make two button Yes and No buttons . when I click on Yes button , its should update as Yes. When I click on No button it should set as No . 

IMG_20210622_095642_compress98.jpg

Please help me with full code's 

Thank you 

12 REPLIES 12
v-qiaqi-msft
Community Support
Community Support

Hi @Yoursnani,

Do you want to assign the specific value to a Yes/No column or a Text column?

Could you please share a bit more about the sceanrio?

Actually, when you save a Text value from your app into the Boolean type column, you must provide a Boolean value for the Yes/No column rather than a Text value.

If you want to save a Text value into the Yes/No column in your SP list within PowerApps, I am afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, please consider change the column type into a Single-line-text type.

Then you could set the Yes/No button OnSelect as below:

 

Patch(SPList2,LookUp(SPList2,ID=xxx),{Test:"Yes"})

 

In addition, if your YES or No column is a text column, you could directly use the above formula.

Hope it could help.

Regards,

Qi

 

Best Regards,
Qi

@v-qiaqi-msft thank you for responding..

 

My scenario is. I have Yes/No column in SharePoint, when it is customizing in powerapps its showing with toggle button . I don't want to toggle button. I want normal button for that column . its Boolean column . can you please share me codes if possible 

Hi @Yoursnani,

Could you please checked my reply one more time?

It is impossible to update the Yes/No column with a Text value.

If you insist on assigning a text value to this column, the only way you could do is to change the column type into a Single-line-text. 

Regards,

Qi

 

Best Regards,
Qi

@v-qiaqi-msft  

I don't want to update text value . I want to when I click yes button . toggle button also update yes . when I click on No button ,toggle button also turn off . this is I want 

Dipak_Shaw
Helper I
Helper I

@Yoursnani Are you using PowerApps custom form in your SharePoint list?

ganeshsanap
Super User
Super User

@Yoursnani Try using this in OnSelect property of Yes button control: 

 

 

Patch(
    SPListDataSource,
    LookUp(SPListDataSource, ID=xxx),
    {
         BooleanColumn: true
    }
)

 

 

 And for No button control: 

 

 

Patch(
    SPListDataSource,
    LookUp(SPListDataSource, ID=xxx),
    {
         BooleanColumn: false
    }
)

 

If you want to change the toggle control in Power Apps itself, you have to do this using variables.


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

 

Best Regards,

Ganesh Sanap

Blog site 

Hi @Yoursnani,

Do you mean that you want to keep the Toogle within the Data card but you want to update the Toggle value based on the Yes or No button?

If so, please try as below.

Set the OnSelect for the yes button as below:

Set(Toggle,true)

Set the OnSelect for the no button as below:

Set(Toggle,false)

Set the Default property of the Toggle control as below:

Toggle

Regards,

Qi

Best Regards,
Qi

@ganeshsanap  thank you for responding . what is ID=xxx should I put exactly what you send or need to change according to my data??

 

Thank you

Hi @Dipak_Shaw 

Yes I am using customer form 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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