cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thosarious
New Member

Incompatible Types Error, PLEASE HELP!

Hi all!

I am developing a SharePoint Form for a SharePoint list. I am trying to have a timer that will grab column data from the current ID and then save that data to a collection and then it is loaded by a checkbox gallery.

I have the code below trying to grab the data and save it but I am getting "Incompatible Types for Comparison. These these types cannot be compared: Number, Text.

 

If(Request.Mode <> FormMode.New, ClearCollect(ColHSEQval,LookUp('Management of Change Request',ID = IDgrab.Text,'HSEQ Impact')), Clear(ColHSEQval)

 

I am using a label to grab the current ID and here is the code for that

If(Request.Mode <> FormMode.New, ThisItem.'MOC ID', Max('Management of Change Request','MOC ID')+1)

 

 

If anyone has any solution please help me I have been stuck for ages! Tried IDgrab.Number instead of IDgrab.Text but it just fails all together then.


Cheers!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-chenzhi
Community Support
Community Support

Hi @Thosarious ,

 

Could you please show me more about your scenes? Do you want to show all the options of a specific ID in the Checkbox?

I assume you have a multiple choice column in SharePoint, create a collection to save Choices with specific ID and display these options with checkboxes.

I have a test for your reference, please try the following workaround.

vchenzhi_0-1637659990945.png

 

Create a collection.

ClearCollect(ColHSEQval,LookUp('1118',ID =1,TTest))

Add a Gallery insert Checkbox.

vchenzhi_1-1637659990946.png

Set the Items property of Gallery to following

ColHSEQval

Set the Text property of Checkbox to following

ThisItem.Value

It will display like this.

vchenzhi_2-1637659990946.png

 

 

Best Regards,

Zhi chen

View solution in original post

4 REPLIES 4
powercorner
Responsive Resident
Responsive Resident

Hello @Thosarious ,

 

the ID of a SharePoint item is always a number type column. You should try to use a static number to test it. For example "ID=2". Just to make sure if the error is coming from this equation. If so, you need to check why IDgrab.number is still a string and not a number. I cannot see how you initiating that record.

 

With regards

Kevin

If(Request.Mode <> FormMode.New, ClearCollect(ColHSEQval,LookUp('Management of Change Request',ID = IDgrab.Text,'HSEQ Impact')), Clear(ColHSEQval)
I think I have found the error. It is that LookUp will only bring back one value. For example, if I select to grab HSEQ Impact from ID 314 it's value is "Manual Handling, Noise (Excessive), Exclusion Zone, Temperature (hot or cold". I am then trying to use the collection that is saved to, to populate checkboxes. However this value is being drawn as one value of ""Manual Handling, Noise (Excessive), Exclusion Zone, Temperature (hot or cold" when it should be "Manual Handing", "Noise (Excessive)", etc.... Meaning that the checkboxes wont relate to this value and check. How do I fix this to bring in each value separately???

hello @Thosarious ,

I am not sure if I understood your problem. Could you provide more pictures of what you are trying to do?

 

With regards

Kevin

v-chenzhi
Community Support
Community Support

Hi @Thosarious ,

 

Could you please show me more about your scenes? Do you want to show all the options of a specific ID in the Checkbox?

I assume you have a multiple choice column in SharePoint, create a collection to save Choices with specific ID and display these options with checkboxes.

I have a test for your reference, please try the following workaround.

vchenzhi_0-1637659990945.png

 

Create a collection.

ClearCollect(ColHSEQval,LookUp('1118',ID =1,TTest))

Add a Gallery insert Checkbox.

vchenzhi_1-1637659990946.png

Set the Items property of Gallery to following

ColHSEQval

Set the Text property of Checkbox to following

ThisItem.Value

It will display like this.

vchenzhi_2-1637659990946.png

 

 

Best Regards,

Zhi chen

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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