cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
steveajones45
Regular Visitor

Help on Incompatible types for comparision

Good Afternoon, 

 

I have created a collection called CollectCollection2 in order to apple a patch function. I am getting an 'incompatible type' Number,text error: 

 

The formula that I have created is as follows:

 

ForAll(

   CollectCollection2,

   Patch('Replines'.

   Lookup('Replines', ValidationAuditId = CollectCollections2[@ValidationAuditId])'

   {OverrideFlag: ThisRecord.OverrideFlag,

   OverrideDescription: ThisRecord.OverrideDescription

   }

)

)

;

 

I believe the error is for the lookup, if I change this to another field the formula seems to work, however, I need to use the ID column. 

 

In the source data (SQL Server table) the filed is an INT

 

Hopefully, this makes sense. 

 

Thank you in advance.

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@steveajones45 

If you carry out the type conversion outside of the lookup, the delegation message will hopefully go away.

ForAll(
   AddColumns(CollectCollection2
    "ValidationAuditIdInt",
    Value(ValidationAuditId)
   )  
   ,
   Patch('Replines',
     Lookup('Replines', ValidationAuditId = ValidationAuditIdInt)'
     {OverrideFlag: ThisRecord.OverrideFlag,
     OverrideDescription: ThisRecord.OverrideDescription
   }
 )
)

 

View solution in original post

4 REPLIES 4
zmansuri
Super User
Super User

To convert text to number just wrap the variable or field inside value brackets. 

Value( )

 

To convert from number to text. Write this in Text brackets:

Text( )

timl
Super User
Super User

@steveajones45 

I'd try this first to see if it solves your problem..

ForAll(
   CollectCollection2,
   Patch('Replines'.
     Lookup('Replines', ValidationAuditId = Value(CollectCollections2[@ValidationAuditId]))'
     {OverrideFlag: ThisRecord.OverrideFlag,
     OverrideDescription: ThisRecord.OverrideDescription
   }
 )
)

Trying this Is get another error:

 

Delegation warning. the 'lookup' part of this formula might not work correctly on large data sets. 

the patch does not update the value in the database. 

timl
Super User
Super User

@steveajones45 

If you carry out the type conversion outside of the lookup, the delegation message will hopefully go away.

ForAll(
   AddColumns(CollectCollection2
    "ValidationAuditIdInt",
    Value(ValidationAuditId)
   )  
   ,
   Patch('Replines',
     Lookup('Replines', ValidationAuditId = ValidationAuditIdInt)'
     {OverrideFlag: ThisRecord.OverrideFlag,
     OverrideDescription: ThisRecord.OverrideDescription
   }
 )
)

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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
Users online (2,423)