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.
Solved! Go to Solution.
Hi @rsongyl
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
Hi @rsongyl
Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))
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
Do you mean "Label13.Text(DateDiff(DatePicker1.SelectedDate,DatePicker2.SelectedDate))"
Don't seem to want to work for me 😞
Regards
RS
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
Hi @rsongyl
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
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
I had something similar with a multiline text field which is in effect duplicated in another exact copy of the main list, In trying to keep both items synced when the fields which I concatenated are updated, I ended up having to use a concat field for a Patch operation for one list, and a variable added into another concatenate formula for the other list. Using the DataCardValue text value always threw up a circular reference error, using the variable to allow me to join the previous values with the new ones to keep the change history worked.