cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
debarbanson
Helper II
Helper II

Check for completeness form returns circular reference

Hi all,

 

Been cracking my head on the following and could really use some help.

I have a form which looks as the below. All fields except select number of load terminals, refer to columns in a sharepoint list.
What I would like to check is the following:

If the number of load terminals = 1, check if Load Terminal is filled, check for arrival date hour, time counts from date hour etc. and if that is all the case, in the field Status Load Terminal (also sharepoint column) indicate "Complete" or "Not Complete").

However when I start my if statement in the default attribute of the Status Load Terminal as follows:
If(Dropdown3.Selected.Value (that's the name of select number of load terminals) = 1 And DataCardValue1.Text (refers to the field Load Terminal 1) <> "", "Complete", "Not Complete" I get an error message stating there is a circular reference.

If I would leave out the Dropdown3.Selected.Value it is OK and I get Complete as result. Any clues on how to solve this?

Screenshot 2021-05-10 at 19.46.51.png

 

In the end I would like to populate complete/not complete in the Status Load Terminal Screen because then in a gallery overview I created I can refer to ThisItem.Status Load Terminal and based on the result Complete/Not Complete I can color the specific item in the gallery.

 

Do hope the above makes a bit of sense. If there is another way of easily tracking if all fields contain a value so I can show the Complete/Not Complete in the gallery overview, that would also be appreciated. Many thanks in advance for any tips.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@debarbanson 

So you need to look at the properties of that datacard (Default and Update) and any other formula you might have in that.  Somewhere you have a formula that refers to an "output" from one of the datacards.

 

You might start by breaking your formula in the Status Load Terminal down.

Try this in the Default property of the DataCardValue3 control:

    If(Dropdown3.Selected.Value = "1", "Test1", "Test2")

If that gives you a circular reference (which you seemed to indicate that if you took it out of the previous formula, was what made the error go away), then track back from the Dropdown.

 

NOW...one bit of clarification.  You said that the Load Terminal Data Card was an added custom datacard.  But, you also provided me with a Default property.  If it was an added datacard, the datacard would not have a default property.  So, could you clarify what is going on there?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

21 REPLIES 21
RandyHayes
Super User III
Super User III

@debarbanson 

What is the Items property of your Dropdown (Dropdown3)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes
debarbanson
Helper II
Helper II

Hi Randy, it contains [1,2]

Logic being that a vessel can either visit 1 or 2 terminals to pick up cargo. So in case they select 2, there will be two fields to indicate the Loading Terminal, arrived time at terminal 1 and arrived time at terminal 2 etc. etc.

debarbanson
Helper II
Helper II

At first I was trying to achieve the same by checking the errormessages I created, in case they were all blank then it's complete otherwise not complete. In a Labelfield I achieved that as follows:


If(Dropdown3.Selected.Value = 1 And ErrorMessage23_1.Text = "" And ErrorMessage24_1.Text = Blank() And ErrorMessage25_1.Text = Blank() And ErrorMessage26_1.Text = Blank() And ErrorMessage27_1.Text = Blank() And ErrorMessage28_1.Text = Blank() And CountRows(DataCardValue10.Attachments) > 0, "Load Terminal Data And Attachments Complete", "Load Terminal Data or Attachments Missing")

and that is working perfectly fine, but same story if I try this in the Status Load Terminal field I get the circular reference warning.

RandyHayes
Super User III
Super User III

@debarbanson 

Okay...was hoping that that would be the smoking gun.

So, let me know the formulas on the following properties:

For Select number of Load Terminal data card:

 - The Default property

 - The Update property

 

For the Status Load Terminal datacard

 - The Default property

 - The Update property

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Load Terminal Data Card:
Default Property: If(IsBlank(LoadTerminal2.Text), 1,2)
Update Property: Don't have it since it's a dropdown field only, not a datacard.

Status Load Terminal
Default property: ThisItem.'Status Load Terminal'
Update: DataCardValue3.Text (where in this text field I want to see Complete/Not Complete

Beginning to think that it has to do with the dropdown option which shows either 1 or 2, dependent on when the initial voyage was submitted, the user inputted any text in Load Terminal 2 text field.
Flow works as follows: Planner at the company inputs the upcoming voyage as a new voyage and fills all relevant data like how many load terminals, ETA etc.

Captain on board then fills the actual arrival date etc. etc. via an edit of the voyage which they select from a gallery (where they can filter on vessel name, voyagenumber, load terminal name etc. etc.


debarbanson
Helper II
Helper II

would it perhaps make it easier if I refer to the number of load terminals by making it a choice field based on sharepoint list column rather then an manual input dropdown?

RandyHayes
Super User III
Super User III

@debarbanson 

No necessarily.   What you are doing is certainly achievable without an additional column.

But, it's very easy to get a circular reference in the form as it relies on a "pass through" of data from the Default to the Update of the Datacards.

 

It sounds as though your Load Terminal Data Card was a custom datacard added to the form and is not related to a column/field in your datasource.

 

But, it refers to LoadTerminal2 - where is that control and what is its Default property?

 

What you have to look for is where any of your formulas relies on a formula from another control, that in turn, relies on a value from the first control.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes
debarbanson
Helper II
Helper II

Correct, the Select Number of Load Terminals is an input dropdown field, so not related to a column in my sharepoint list.

The LoadTerminal2 refers to the datasource column Load Terminal 2. The datacard value has as default Parent.Default and the datacard has as default ThisItem.'Load Terminal 2'

RandyHayes
Super User III
Super User III

@debarbanson 

I did not see a Load Terminal 2 datacard in your form picture...is it something else?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,412)