cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rsongyl
New Member

Circular reference Between Properties

Hi all 

 

I'm very new to poweapps and trying to find my way around by programming very basic app. My first task is to develop a leave estimator to assist staff to determine if they have enough leave balance for a proposed leave date. There is no data source link to this app and everything is calculated based on user's input i.e. current leave balance, proposed leave date etc.. In the future we would expand this out to pull out leave balance data from a data source. 

 

Anyhoo I'm trying to get the following command to return the DateDiff in Text

 

Label13.Text = Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))

 

However the system throws out the "This rule creates a curcular reference between properties which is not allowed. A property cannnot reference itself or other properties affected by its value. " 

 

How do i fix this? Or is there a worksround it. 

 

Thanks in advance

RS.

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Circular reference Between Properties

Hi @rsongyl 

 

No just use the expression:
Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))MicrosoftTeams-image (199).png

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 

View solution in original post

8 REPLIES 8
PavanKumar Responsive Resident
Responsive Resident

Re: Circular reference Between Properties

Hi Rsongyl,

 

Once try to use variables instead and see if its still giving issue.

 

Instead of Label13.Text = Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))

Use

Set(pick1,DatePicker1.SelectedDate);

Set(pick2,DatePicker2.SelectedDate);

Set(diff,DateDiff(pick1,pick2));

Label13.Text = Text(diff);

 

Please mark it as verified if it answers your question.

Regards,

Pavan Kumar Garlapati

Dual Super User
Dual Super User

Re: Circular reference Between Properties

Hi @rsongyl 

 

I carried out a test on my side and this issue can be resolved by using the formula:
 
Expression: 
Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))
 
This can be placed on the "Text" property of Label13.
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
rsongyl
New Member

Re: Circular reference Between Properties

Hi @PavanKumar  

 

Where do you set the global variable for the following?

 

Set(pick1,DatePicker1.SelectedDate);

Set(pick2,DatePicker2.SelectedDate);

Set(diff,DateDiff(pick1,pick2));

 

Sorry, new to powerapps. 

 

Regards

RS

rsongyl
New Member

Re: Circular reference Between Properties

@yashag2255 

 

Do you mean "Label13.Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))"

 

Don't seem to want to work for me 😞 


Regards

RS

PavanKumar Responsive Resident
Responsive Resident

Re: Circular reference Between Properties

Hi,

 

On change of selected date set the variables and calculate the difference whenever you want to calculate (either onchange of field or click of button).

 

Mark it as verified if it answers your question.

Regards,

Pavan Kumar Garlapati

Dual Super User
Dual Super User

Re: Circular reference Between Properties

Hi @rsongyl 

 

No just use the expression:
Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))MicrosoftTeams-image (199).png

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 

View solution in original post

Highlighted
Dual Super User
Dual Super User

Re: Circular reference Between Properties

Hi @rsongyl 

 

On the Label13 control on your form

Go to properties and search for the Text property

Then use Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate)) for the text property

Capture.PNG

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

rsongyl
New Member

Re: Circular reference Between Properties

Thanks @PavanKumar  i might be able to use this for something else. Thumbs up!

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Attending MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’re streaming the digital event live, or watching on-demand, claim your attendee badge to sport on your profile.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We're launching a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Emergency Response & Monitoring Solution

Emergency Response & Monitoring Solution

Microsoft has created a regional government emergency response and monitoring solution that is built on Power Apps and Power BI.

Top Solution Authors
Top Kudoed Authors
Users online (5,918)