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

Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi Everyone,

Can anyone tell me how to solve this? I'm calling a table from database to display in power-apps table below is my formula and provided attachments. 

Sort(Filter('[dbo].[RequestTrail]', Active = 1 && DateValue(Text(TransactionDate),"en") >= DateValue(Text(AuditTrailFromDatePicker1.SelectedDate))
&& DateValue(Text(TransactionDate),"en") <= DateValue(Text(AuditTrailToDatePicker1_1.SelectedDate)) ),SequenceNo, Ascending)

Thank you so much.

 

 



2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi @Big_S 
 
Can you confirm that your Active field in the db table is a Number field? I replicated the formula in my app and it seems like the date filter works just fine. 
 
Thanks,

View solution in original post

Dual Super User
Dual Super User

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

@Big_S 

 

What is the type of Active field in you sharepoint list, can you please confirm? 
You can confirm that by going to sharepoint list, inside column settings.
If it is Yes/No field, then you need to send data in the form of boolean i.e. true/false
MicrosoftTeams-image (60).png

Hope this Helps!

View solution in original post

10 REPLIES 10
Dual Super User
Dual Super User

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi @Big_S 
 
Can you confirm that your Active field in the db table is a Number field? I replicated the formula in my app and it seems like the date filter works just fine. 
 
Thanks,

View solution in original post

Highlighted
Big_S Helper IV
Helper IV

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

I also try another table the formula works fine, I'll check the active and update you Thank you so muchhhh ❤️

Big_S Helper IV
Helper IV

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Yes!! you're right its a number? do I need to convert it to text? how to do it?

Dual Super User
Dual Super User

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi @Big_S , 

 

You don't have to convert that, the number comparison works fine with the filter command.

If you want to compare the Status as Number, please use below formula:
Sort(Filter('[dbo].[RequestTrail]', Value(Active) = 1 && DateValue(Text(TransactionDate),"en") >= DateValue(Text(AuditTrailFromDatePicker1.SelectedDate))
&& DateValue(Text(TransactionDate),"en") <= DateValue(Text(AuditTrailToDatePicker1_1.SelectedDate)) ),SequenceNo, Ascending)

 

If you want to do a string comparison:
Sort(Filter('[dbo].[RequestTrail]', Text(Active) = "1" && DateValue(Text(TransactionDate),"en") >= DateValue(Text(AuditTrailFromDatePicker1.SelectedDate))
&& DateValue(Text(TransactionDate),"en") <= DateValue(Text(AuditTrailToDatePicker1_1.SelectedDate)) ),SequenceNo, Ascending)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Big_S Helper IV
Helper IV

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi @yashag2255 

 

I tried the first formula i got this error, below I used gallery to view the data for checking database connection only.
The second formula no error but no display

s1.png

Dual Super User
Dual Super User

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi @Big_S 
 
From what I see as per your screenshot, your Status field is not of type Integer, it holds values, request and approved, but here in the formula, you are comparing it with a number.
 
Conversion to integer failed because "Request" and "Aproved" can not be converted to type interger.
 
While, conversion to string getting no records, because there is no such entry where status is one.
 
Hope this Helps!
Big_S Helper IV
Helper IV

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

hi @yashag2255 

 

I think the Active is not an integer am i right?

s2.png

Dual Super User
Dual Super User

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

@Big_S 

 

What is the type of Active field in you sharepoint list, can you please confirm? 
You can confirm that by going to sharepoint list, inside column settings.
If it is Yes/No field, then you need to send data in the form of boolean i.e. true/false
MicrosoftTeams-image (60).png

Hope this Helps!

View solution in original post

Big_S Helper IV
Helper IV

Re: Incompatible Type. We can't evaluate your formula because the values being compared in the formula aren't the same type.

Hi @yashag2255 

 

Active is bit data type


s3.PNG

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,710)