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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Newbie having a few pr...
Power Apps
Unanswered

Newbie having a few problems

(0) ShareShare
ReportReport
Posted on by 6

Hello,

 

I'm trying to create a simple phone app to track sales and I'm having 2 main issues. Sorry in advance if these issues I'm about to present should be easy fixes. If anyone can help, I'd greatly appreciate it.

 

1) Error message: "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. "

 

I thought maybe if I went through the whole app and made sure everything looked consistent that this would clear itself, it didn't.

 

EditForm(QuoteDetailsForm);
Navigate(QuoteDetailsPage,ScreenTransition.Fade,
{EditRecord:ThisItem,
type:ThisItem.Status,
assign:ThisItem.SalesTerritory,
area1:ThisItem.Owner,
priority:ThisItem.Priority,
disabledcomment:true,
disabledsubject:true,
disableddesc:true,
subjv:true,
descv:true,
commv:true})

 

2) Error Message: "Expected Operator. We expected an operator such as +, *, or & at this point in the formula."

 

Navigate(QuoteDetailsPage, ScreenTransition.Fade,
{EditRecord:ThisItem,
type:ThisItem.Status
assign:ThisItem.SalesTerritory,
area1:ThisItem.Owner,
priority:ThisItem.Priority,
disabledcomment:true,
disabledsubject:true,
disableddesc:true})

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @CSC79 

    Welcome to PowerApps!

     

    First for the #2 question...you are missing a comma!

    RandyHayes_0-1648686476065.png

     

    As for the rest.  Number one rule in PowerApps - Keep It Super Simple!

    You are creating more work for yourself with all the variables.  Variables are great in a development platform, but PowerApps is NOT development.  PowerApps is designed after Excel, so just like Excel, it references things with formulas to derive what it needs.  This is far easier than development!

     

    So, in your case, this appears to be a formula on an OnSelect of perhaps a gallery or control in a gallery.  If so, then simplify your formula to:

    Set(glbCurrentRecord, ThisItem);
    EditForm(QuoteDetailsForm);
    Navigate(QuoteDetailsPage,ScreenTransition.Fade})

    Change the Item property of your QuoteDetailsForm to: glbCurrentRecord

    You can use this variable anywhere and it is STILL a record.  So, if you need to display the priority somewhere else outside of your form (for example), then glbCurrentRecord.Priority is all you need.  Making more variables in the app just confuses your design.

     

    For the Boolean variables in your formula, it is hard for me to say for sure how to eliminate them because I am not sure of your purpose and they are just a hard-written value, but whatever you are using them in can simply be true or false or a formula that will evaluate to true or false.

     

    See where that gets you and if it clears up some things for you.

     

    I hope this is helpful for you.

  • CSC79 Profile Picture
    6 on at

    Thanks a lot for the help @RandyHayes, that was really helpful and cleared those errors. I do have one more error. I have the following code on all of the cards and it only is throwing an error on one of them.

     

    "Unexpected characters. Characters are used in the formula in an unexpected way."

     

    DataSourceInfo(%DATACARD_DATASOURCE_NAME.ID%, %DataSourceInfo.RESERVED%.MaxLength, "%DATACARD_FIELD_NAME.ID%")

     

    Error.jpg

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @CSC79 

    First thing I notice about that picture is that you have NO datasource attached to your form.

    You need to specify your Datasource for the form.  Otherwise, the form is pretty useless and you will certainly see errors for functions that are trying to get info about the datasource!

  • CSC79 Profile Picture
    6 on at

    I thought that might be the case. The one time I was actually able to access the link to attach a data source, I selected the source to be used and there wasn't a change. I guess I would have expected the same error for all of the cards in this scenario, so I thought I'd be able to get the error to clear. I'll try to figure out the data source issue and let you know if it clears the errors.

  • CSC79 Profile Picture
    6 on at

    @RandyHayes

     

    That was pretty simple. Sometimes I wish it wasn't in my nature to overlook the simplest of solutions. In my mind, the issue is always more complex than it actually is.

     

    If you don't mind and have time, could you possible help me with one more?

     

    "Incompatible types for comparison. These types can't be compared: DateTime, Text

     

    If(type="All",
    Quotes_1,
    type="Quotes older than 3 days",
    Filter(Quotes_1,DateCreated <> DateClosed && DateCreated <> DateTimeValue(Today()), DateCreated <> DateTimeValue(DateAdd(Today(), -2)),DateCreated <> DateTimeValue(DateAdd(Today(), -1))|| DateClosed <> DateCreated && DateClosed <> DateTimeValue(Today()), DateClosed <> DateTimeValue(DateAdd(Today(),-2)),DateClosed <> DateTimeValue(DateAdd(Today(), -1))),
    type="Quotes opened today",Filter(Quotes_1,datetype in DateCreated),
    type="Quotes closed today",Filter(Quotes_1,datetype in DateClosed),Filter(Quotes_1,type in Status))

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard