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 / Circular Reference Error
Power Apps
Unanswered

Circular Reference Error

(0) ShareShare
ReportReport
Posted on by 112

On the DefaultDate property of a Date field I have (DataCardValue13) I'm trying set the default date to Today - only if this is the editform and the current date is empty.  But I'm getting the following error.

 

This rule creates a circular reference between properties which is not allowed.

 

Here's my formula:

If(SharePointForm1.Mode = 0 && IsBlank(Self.SelectedDate),
 Today(),
 Parent.Default
)

 

How do I reference the current field this formula is on?  It doesn't like the Self.SelectedDate currently.

 

Thanks

 

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @greddin 

    First, before investigating other aspects that might be at play, change your formula to the following:

    Coalesce(Parent.Default, Today())

    If that doesn't resolve it, then please provide the Default property of your Datacard.

     

    I hope this is helpful for you.

  • greddin Profile Picture
    112 on at

    The Coalesce you gave seems to work without error.  But I loose the ability to check if the form is in edit mode.  This is a SharePoint custom PowerApp form.

     

    The Default property of the datacard is: ThisItem.'Completed Date'

     

    Thanks again

  • greddin Profile Picture
    112 on at

    This seems to work so maybe this is how I should I done it?

     

    If(SharePointForm1.Mode = 0 && IsBlank(Parent.Default),
     Today(),
     Parent.Default
    )
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @greddin 

    What would be the difference in the mode?  Are you trying to preserve blank values if editing a record?

    If so, then you can revisit your formula (in which the issue was your reference to Self)

     

    Your goal is to preserve a blank date if editing, then the better choice is to not reflect on the form mode, but instead the underlying record.

    The formula would then be:

    If(!IsBlank(ThisItem.ID),
     Coalesce(Parent.Default, Today())
    )
  • greddin Profile Picture
    112 on at

    My goal is to set the default date for the date field to today's current date.  But only if the form is in edit mode.  My reasoning for this is if there is already an existing date value then I don't want to overwrite that with the new date but perserve it.  This is why I am concerned about the edit mode.  Thanks for your thoughts.

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

    @greddin 

    Yes, so that last formula I presented to you will do exactly that.  Don't rely on your form mode though like that as you are stating this:

    "if there is already an existing date value then I don't want to overwrite that with the new date but perserve it.  This is why I am concerned about the edit mode."

    You CAN be in edit mode with a new record!!  So, if you rely on the mode, then your formula would fail.  If instead you look for the existence of the actual record (your record would have an ID if it exists and would be blank if not), then you will not go wrong!

    That is what that formula does.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard