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 / When form combobox cha...
Power Apps
Unanswered

When form combobox changes, record date/time of change

(0) ShareShare
ReportReport
Posted on by 523

I have a form which contains a ComboBox DataCardValue92, based on a CDS column "Opportunity Status."

It's Items value is: SortByColumns(Choices([@Projects].'Opportunity Status'),"cr6a2_order")

 

Then I have another card on the form based on a date/time column. I want to use this to write the current date/time if and when the value of DataCardValue92 changes.

The Date box of this card is labelled DateValue5. Within the DefaultDate of that box, I am using this code:

If(ThisItem.'Opportunity Status'.Forecasting = DataCardValue92.Selected.Forecasting,Parent.Default, Now())

But I am receiving two errors in this code.

The first is for DataCardValue92, that "powerapps encountered an internal error trying to evaluate this expression."

The second is that "this formula uses scope which is not presently supported for evaluation."

 

Would anyone be so kind as to guide me where my code is going wrong?

Thanks!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @Medoomi ,

    Try

    If(
     ThisItem.'Opportunity Status'.Forecasting = DataCardValue92.Selected.Forecasting,
     ThisItem.YourDateFieldName, 
     Today()
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Medoomi Profile Picture
    523 on at

    Thanks so much @WarrenBelz ,

    I tried the code above, but the two errors are still being reported:

    DataCardValue92 - "powerapps encountered an internal error trying to evaluate this expression."

    entire code snippet - "this formula uses scope which is not presently supported for evaluation."

    The code *appears* to work, but I'm assuming I really should track down what's causing the errors?

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @Medoomi ,

    I tried the obvious first (making the two possible values on the second line the same type).

    So now going to the first line, put two labels in a custom card in your form with

    ThisItem.'Opportunity Status'.Forecasting

    and

    DataCardValue92.Selected.Forecasting,

    and see if you get values in both

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Medoomi Profile Picture
    523 on at

    thx @WarrenBelz 

    ThisItem.'Opportunity Status'.Forecasting

    displays "Sold," with a data type: text

    DataCardValue92.Selected.Forecasting

    also displays "Sold," with a data type: text

    Is there any other place I can look?

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @Medoomi ,

    There are only two parameters here - as a final test (which I am sure will show true), put this on a Label in the form

    ThisItem.'Opportunity Status'.Forecasting = DataCardValue92.Selected.Forecasting

    If so, the issue has to be with the Date field - so a button

    UpdateContext({varDate:ThisItem.YourDateFieldName})

    look in View > Variables and see if varDate is a date

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Medoomi Profile Picture
    523 on at

    @WarrenBelz  Thank you so very much again.

    Yes, the first parameter checked out fine, with the result "true."

    When I put the code from the second parameter in a button the following part of the formula:

    ThisItem.'OP Status Change Date'

    (the column in question) generated the error "this formula uses scope, which is not presently supported for evaluation." It also listed the data type as DateTime.

    Pressing the button did not enter a value (as the column is presently empty), but when I checked variables, it listed VarDate as "DateTime"

    Is there a way to narrow down what's happening? thanks!

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @Medoomi ,

    I have done a test here - the details are below. Can you please see what is different with your model.

    • My List is TestFields
    • DateTest is a Date (only) field
    • ChoiceTest is a single choice field with A,B,C,D
    • Both combo boxes are based on the field with the top one (in the form) showing the current field value and the bottom one (outside the form) being used to select the value to compare

    Code on the DefaultDate of the DatePicker

    WarrenBelz_0-1612041366644.png

    Different choice made - shows the date currently in the list

    WarrenBelz_1-1612041445386.png

    Same choice - shows the current day

    WarrenBelz_2-1612041481006.png

    The point is that the DefaultDate code is valid providing the field in the List is a Date field.

    Can you please see what is different here.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

     

     

  • Medoomi Profile Picture
    523 on at

    @WarrenBelz 

    Thank you so very much for detailing the setup, I really appreciate it.

    It seems the problem is with the simple code: ThisItem.Anything

    When I use it in a DataCard eg. on a label, visually it works (it correctly pulls the data from any column on the record), but it doesn't matter which column this is, it invokes the error for all of them being any data type: "this formula uses scope, which is not presently supported for evaluation."

    I have refreshed data connections for what that's worth. Could there be a reason why this code would invoke an error for every column?

  • Medoomi Profile Picture
    523 on at

    @WarrenBelz I wondered if you could direct me,

    I re-created your example, making ChoiceTest a lookup column.

    As soon as I enter ThisItem.ChoiceTest into DefaultDate of the date picker, the system flags it with "the formula uses scope, which is not presently supported for evaluation."

    Is there a way I can get around this error?

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @Medoomi ,

    Are you using a form or simply putting the controls on the screen? ThisItem has to work in a Form.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard