cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Get bool value from SP list

Hello so im trying get bool value from my SP list, but im getting error (Invalid argument type (Table))

 

Can someone explain what im doing wrong?

 

Error:


attendtable.PNG

 

splist.PNG

Above is error and my SP list.

 

Thanks for all anwers.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Get bool value from SP list

You are getting the text error because Attendance is defined as a single line of text column, not a Yes/No (boolean) column.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Super User
Super User

Re: Get bool value from SP list

You’ll want to use a Yes/No column. If you no longer have the option you might need to delete the column and re add.

View solution in original post

12 REPLIES 12
Highlighted
Super User
Super User

Re: Get bool value from SP list

@Corbie 

 

Your toggle appears to be in a gallery.  In general you can use this code assuming the yes/no field in SP is called Attendance:

 

If(ThisItem.Attendance,true,false)

But to really understand the problem you'll need to share what property of the toggle you are changing.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

Highlighted
Dual Super User II
Dual Super User II

Re: Get bool value from SP list

YOu don't want to test the datasource.Attendance.  You want to test ThisItem.Attendance.  If you do it for the data source you get a single column table of all the values for all the records in that field.  You want just the value for that particular record.  So your formula should read 

If(ThisItem.Attendance,


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper I
Helper I

Re: Get bool value from SP list

@mdevaney 

 

Yeah its in gallery, i wanna change property of OnSelect. i just wanna togle betweeen false and true and change them in SP List too.

I tried approach with OnCheck and UnCheck property but it didnt worked so i wanna try it with OnSelect property.

 

Thanks  @Pstork1 foe explanation,  but im getting error again this time with "text" instead of boolean.

 

gfdgfd.PNG

Highlighted
Super User
Super User

Re: Get bool value from SP list

@Corbie 

If you want to change a value in Sharepoint this slider should be part of an Edit Form and you'd need to write a Submit function inside of the OnSelect property of the toogle.  If you don't submit the form the data does not get written to Sharepoint.

Highlighted
Dual Super User II
Dual Super User II

Re: Get bool value from SP list

Can we see the List settings for the list?  I mocked this up with a Yes/No column and ThisItem.Column name comes through as a Boolean for me.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper I
Helper I

Re: Get bool value from SP list

@mdevaney 

I followed tutorial from this guy:

https://www.youtube.com/watch?v=QLZzeQEgv4g

It worked for him, but im going to try it with edit form as you suggested, let you know if it is what im looking for.

 

Thanks for answers.

Highlighted
Helper I
Helper I

Re: Get bool value from SP list

@Pstork1 

 

What do you need exactly? So much stuff in here 😄

listsettings.PNG

Highlighted
Dual Super User II
Dual Super User II

Re: Get bool value from SP list

You are getting the text error because Attendance is defined as a single line of text column, not a Yes/No (boolean) column.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Helper I
Helper I

Re: Get bool value from SP list

@Pstork1 Oh i thought it will like convert it by it self.

 

Can you just navigate me where i can change it to yes/no column?

Because its imported from excel spreadsheet so if it is even possible?

 

Really thanks again,

 

Sorry for stupid questions but i started to learning powerapps yesterday

 

//EDIT:: I figured it out, thanks for all answers.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,618)