web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Incompatible with the ...
Power Apps
Answered

Incompatible with the types of values in other places in your app

(0) ShareShare
ReportReport
Posted on by 219

Hello,

 

I have an IF statement which looks at the selected value of a dropdown box and then depending on the value, it will then create a new record in specified dataverse table. If i was to remove the second condition from the IF statement so its just creating the record in CDA_Conv_Recordss table then it works fine. Only when i add a second condition am i getting the following error message.

Error:

 

Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.

 

Code:

 

If(
 varSelectedEnviro.Value = "Convenience",
 Set(
 varRecordID,
 Patch(
 CDA_Conv_Recordss,
 If(
 varRecordType = "New",
 Defaults(CDA_Conv_Recordss)
 ),
 {
 Salesforce: Value(varSFAcc),
 Employee: varEmployee,
 Environment: Dropdown1.Selected.Value
 }
 )
 ),
 varSelectedEnviro.Value = "Horeca",
 Set(
 varRecordID,
 Patch(
 CDA_Horeca_Recordss,
 If(
 varRecordType = "New",
 Defaults(CDA_Horeca_Recordss)
 ),
 {
 Salesforce: Value(varSFAcc),
 Employee: varEmployee,
 Environment: Dropdown1.Selected.Value
 }
 )
 )
);

 

 

As I'm writing this, I'm thinking its because I've got the varRecordID being set twice, when technically its only going to be set once depending on the value of varSelectedEnviro. So maybe i need to put the IF statements where the table is defined instead, am i on the right page here?

 

Any help would be much appreciated, thank you in advance.

Categories:
I have the same question (0)
  • Verified answer
    realwillwright Profile Picture
    772 Moderator on at

    Hi @CCEP_Mike 

     

    You would need to set a different variable for the second patch. It is patching to a different data source so the resulting variables would be different. If you want a single variable for the recordid you could do something like this

     

     

    If(
     varSelectedEnviro.Value = "Convenience",
     Set(
     varRecordID_ConvRecords,
     Patch(
     CDA_Conv_Recordss,
     If(
     varRecordType = "New",
     Defaults(CDA_Conv_Recordss)
     ),
     {
     Salesforce: Value(varSFAcc),
     Employee: varEmployee,
     Environment: Dropdown1.Selected.Value
     }
     )
     ),
     varSelectedEnviro.Value = "Horeca",
     Set(
     varRecordID_HorecaRecords,
     Patch(
     CDA_Horeca_Recordss,
     If(
     varRecordType = "New",
     Defaults(CDA_Horeca_Recordss)
     ),
     {
     Salesforce: Value(varSFAcc),
     Employee: varEmployee,
     Environment: Dropdown1.Selected.Value
     }
     )
     )
    );
    Set(varRecordID, Coalesce(varRecordID_HorecaRecords.RecordId, varRecordID_ConvRecords.RecordId))

     

     

    You would have to ensure the initial variables are blank before running the patch, else the coalesce won't work

    -------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • CCEP_Mike Profile Picture
    219 on at

    @realwillwright thank you very much for the help. I understand what you've said and implemented it successfully. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard