cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Corbie
Level: Powered On

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
Super User
Super User

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

mdevaney
Level 8

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
mdevaney
Level 8

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."

Super User
Super User

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.
Corbie
Level: Powered On

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

mdevaney
Level 8

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.

Super User
Super User

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.
Corbie
Level: Powered On

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.

Corbie
Level: Powered On

Re: Get bool value from SP list

@Pstork1 

 

What do you need exactly? So much stuff in here Smiley Very Happy

listsettings.PNG

Super User
Super User

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

Corbie
Level: Powered On

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 448 members 5,243 guests
Please welcome our newest community members: