cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Super User
Super User

Perfectly working app quits working... "Incompatible type column in the data source you're updating expects a 'Text' type and you're using an 'Error' type". Please advise!

I was running my final app updates and was quite happy with about 30min of testing with no errors.  I save the app, and publish it...  Now it is broken.  Strange "type" issues.  I thought it had to do with some mixing of Set() and UpdateContext().  That was entirely cleared up an hour ago, but this keeps happening...  App is great... but after save and reload, these type errors appear everywhere that I use these two particular vairables.

 

image.png

Variable is devined in the "X" shown above:

 

UpdateContext({ShowActivateBom:true});

UpdateContext({TempStartwith:Gallery_MD.Selected.MD_PartNumber,CurrentPartNumber:Gallery_MD.Selected.MD_PartNumber});

ClearCollect(PickHistory,({PickID:1,TmpSearch:CurrentPartNumber, CurrentPtNo:CurrentPartNumber})); UpdateContext({CurrentPickID:1});

Concurrent(

Set(AcctProductInfo,LookUp('[dbo].[tbProduct]',ProductID=CurrentPartNumber)),
Set(AcctViewInfo,LookUp('[dbo].[VIEW_POWERAPPS_BASIC_ACCTIVATE_DATA]',ProductID=CurrentPartNumber))

);

UpdateContext({ShowActivateBom:true})

Please dont say this is another issue with using .Selected from a gallery.

1 ACCEPTED SOLUTION

Accepted Solutions

Ok, finally got it.  Since this was a "type" problem, in my definition statement, I explicitly stated Text() to be sure that the type was properly set to string for CurrentPartNumber and TempStartwith variables.  This should not have been required, since the source data is clearly text already.  Some of these values are all numbers, so i'm presuming it was erroneously setting them as integer.  However, why did that not happen when originally edited in edit mode?

UpdateContext({ShowActivateBom:true});

UpdateContext({TempStartwith:Text(Gallery_MD.Selected.MD_PartNumber),CurrentPartNumber:Text(Gallery_MD.Selected.MD_PartNumber)});

ClearCollect(PickHistory,({PickID:1,TmpSearch:Text(CurrentPartNumber), CurrentPtNo:Text(CurrentPartNumber)})); UpdateContext({CurrentPickID:1});

Concurrent(

Set(AcctProductInfo,LookUp('[dbo].[tbProduct]',ProductID=CurrentPartNumber)),
Set(AcctViewInfo,LookUp('[dbo].[VIEW_POWERAPPS_BASIC_ACCTIVATE_DATA]',ProductID=CurrentPartNumber))

);

UpdateContext({ShowActivateBom:true})

I guess this is one of the problems with automatically interpreting variable types, which eliminates variable initialization, but it doesnt always get it right.

View solution in original post

4 REPLIES 4
Brentless
Kudo Kingpin
Kudo Kingpin

For what its worth, I am seeing very similar weirdness (in another post) - and I dare not publish -- it appears to me the editor has a bug that needs to be addressed asap.

 

https://powerusers.microsoft.com/t5/General-Discussion/Forms-and-SQL-Views-Broken-Expected-a-value-c...

 

I have traced the issue down to a statement in a icon OnSelect that I'm using to backup through a selection sequence.  If I delete this statement, all the red "X" go away, and everything works.

 

The oddest part... if I paste this statement back into the Icon, it works just fine!  Until I save/close/reopen.  When reopened, all of the "X" reappear.  This is repeatable.  I cant think of anything in this statement that could be in question.

 

Thoughts??

 

UpdateContext({CurrentPickID:CurrentPickID-1}); UpdateContext({CurrentPartNumber:LookUp(PickHistory,PickID=CurrentPickID,CurrentPtNo)});

UpdateContext({TempStartwith:LookUp(PickHistory,PickID=CurrentPickID,TmpSearch)});

Set(AcctProductInfo,LookUp('[dbo].[tbProduct]',ProductID=CurrentPartNumber));
Set(AcctViewInfo,LookUp('[dbo].[VIEW_POWERAPPS_BASIC_ACCTIVATE_DATA]',ProductID=CurrentPartNumber));

Reset(Dropdown2);Reset(TextInput6)

Ok... Here's what I narrowed it down to.  

 

The statement above... the "RED" content is what is causing the issue.  

 

UpdateContext({CurrentPickID:CurrentPickID-1}); UpdateContext({CurrentPartNumber:LookUp(PickHistory,PickID=CurrentPickID,CurrentPtNo)});

UpdateContext({TempStartwith:LookUp(PickHistory,PickID=CurrentPickID,TmpSearch)});

Set(AcctProductInfo,LookUp('[dbo].[tbProduct]',ProductID=CurrentPartNumber));
Set(AcctViewInfo,LookUp('[dbo].[VIEW_POWERAPPS_BASIC_ACCTIVATE_DATA]',ProductID=CurrentPartNumber));

Reset(Dropdown2);Reset(TextInput6)

If I remove that statement, it will save and retrieve, and even publish with no problem.  This is not the solution, but simply finding the specific statement in crisis.  I see nothing fundamentally wrong with how it is written.  Notice the statement in "GREEN".  Its the same syntax but simply getting a different column result.  It seems to not be causing any issue.  PickHistory is a simple collection that is created in the app.  It works great in editor mode, prior to save and subsequent retrievel.  I still need a solution for why, so that I can get this function working ASAP!

Ok, finally got it.  Since this was a "type" problem, in my definition statement, I explicitly stated Text() to be sure that the type was properly set to string for CurrentPartNumber and TempStartwith variables.  This should not have been required, since the source data is clearly text already.  Some of these values are all numbers, so i'm presuming it was erroneously setting them as integer.  However, why did that not happen when originally edited in edit mode?

UpdateContext({ShowActivateBom:true});

UpdateContext({TempStartwith:Text(Gallery_MD.Selected.MD_PartNumber),CurrentPartNumber:Text(Gallery_MD.Selected.MD_PartNumber)});

ClearCollect(PickHistory,({PickID:1,TmpSearch:Text(CurrentPartNumber), CurrentPtNo:Text(CurrentPartNumber)})); UpdateContext({CurrentPickID:1});

Concurrent(

Set(AcctProductInfo,LookUp('[dbo].[tbProduct]',ProductID=CurrentPartNumber)),
Set(AcctViewInfo,LookUp('[dbo].[VIEW_POWERAPPS_BASIC_ACCTIVATE_DATA]',ProductID=CurrentPartNumber))

);

UpdateContext({ShowActivateBom:true})

I guess this is one of the problems with automatically interpreting variable types, which eliminates variable initialization, but it doesnt always get it right.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,980)