cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
indhaa
Impactful Individual
Impactful Individual

This rule create a circular reference - Gallery-Selected-ID

Hi

 

I have something complicated. Hope my explanation is clear

 

So I have three forms, External User Form, Firewall Access Form, VPN Access Form.

So what I have done is if a user want three access , he can submit only one form which will create the other access too. So a user might request only for External    OR   External/VPN     OR    External/VPN/Firewall etc. 

 

After access if he open the External Access VIEW form. if he have requested for others he can see in the gallery created inside the form the respective details of the other form too.

 

So in addition to gallery created to view/edit in these three forms, inside the form there is gallery referring to other forms. Hope my explanation is clear so far. 

 

So there is two more galleries referring to the same form, so I use a filter to get the correct record in view form mode, 

 

Example

So below is my External Form and The Gallery details. So I use the filter for VPN Gallery as below

indhaa_2-1622315170012.png

If(varVPNExtGallery,Filter(VPNAccess, ExtFormID = VPNExtGallery.Selected.ID),Filter(VPNAccess,ExtFormID = ExternalGallery.Selected.ID))

indhaa_1-1622314864180.png

 

So below is my VPN form and External Gallery details.

 

indhaa_3-1622315299144.png

When I try to filter it is saying circular reference error. How can I filter selected item without creating a circular reference

indhaa_4-1622315639385.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @indhaa ,

Are you setting galID to ThisItem.ID on the OnSelect of your galleries?

Set(galID,ThisItem.ID)

Then your Form Item would be

LookUp(
   VPNAccess,
   ID = galID
)

A couple of questions I should have asked - what is your data source (I have assumed SharePoint).
What is ExtFormID ?

 

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.

View solution in original post

10 REPLIES 10
WarrenBelz
Super User
Super User

HI @indhaa ,

Firstly, the below is a shorter way of doing it, but your code should not create a Circular Reference on its own - there must be another piece of code conflicting with it. How do you create varVPNExternalGallery?

With(
   {
      wID:
      If(
         varVPNExtGallery,
         VPNExtGallery.Selected.ID,
         ExternalGallery.Selected.ID
      )
   },
   Filter(
      VPNAccess, 
      ExtFormID = wID
   )
)

Also, there is probably a better way of doing this - on the OnSelect of each gallery, put

Set(gblID,ThisItem.ID)

then the Item of your Form would be

Filter(
   VPNAccess, 
   ExtFormID = gblID
)

 

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.

indhaa
Impactful Individual
Impactful Individual

So I think it is creating circular reference because of this. I think due to this it is still creating havoc in the form.

 

So External Form item property is set like this

 

indhaa_1-1622404652757.png

The On Select of the Gallery inside External Form is set like below

 indhaa_0-1622404573676.png

 

VPN Form Item property is set like this 

indhaa_2-1622404812490.png

And On Select property of the Gallery on VPN form like below

indhaa_3-1622404893981.png

 

or maybe because it is referring to it's own record from the gallery. Still not working correctly

 

@indhaa ,

Did you attempt the code I sent where you are setting the required ID and then doing a LookUp - I use this successfully on a number of forms where I navigate to them from different places. I still cannot see anything in your code supplied that would create a Circular Reference.

 

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.

indhaa
Impactful Individual
Impactful Individual

hi

 

Hope you are online now

I have updated my code as you have requested and it is not prompting that circular reference error but I still think due to this reference it is creating a havoc in my form. Now from the form gallery it is not filtering the forms related to it and the form also not showing data when I click on it sometimes. 

Filter(
VPNAccess,
ExtFormID = galID
)

I think it is creating circular reference because I'm going to same the form when I click the record in the form gallery and when it open the form it is referring to its own record some how. or maybe due to variable I created it is creating the reference. Can you check my form item property code is ok



 

Hi @indhaa ,

Are you setting galID to ThisItem.ID on the OnSelect of your galleries?

Set(galID,ThisItem.ID)

Then your Form Item would be

LookUp(
   VPNAccess,
   ID = galID
)

A couple of questions I should have asked - what is your data source (I have assumed SharePoint).
What is ExtFormID ?

 

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.

View solution in original post

indhaa
Impactful Individual
Impactful Individual

So I will do that and let you know. Now kind of busy with another project, so might be late with my response.

 

yes it is SharePoint list. So I said it is three SP List and each form will have respective ID of the other form so I will know to compare the related form. Hope u get what I'm trying to do. Don't know if it is the correct way to do it,

External SP List   ID, VPNFormID, FirewallFormID

VPN SP List         ID, ExtFormID, FirewallFormID

Firewall SP List    ID, VPNFormID, ExtFormID

 

 

Hi @indhaa ,

If this is SharePoint, forget all your other Variables and simply set one to the ID of the item selected in the gallery, then use the code I supplied for the form Item - I do this in a lot of my apps.

 

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.

indhaa
Impactful Individual
Impactful Individual

Hi,

 

So I updated my Form Item property (Not Gallery Item property) as below and I'm getting the below error for it. 

indhaa_0-1622557350824.png

indhaa_1-1622557461783.png

 

@indhaa ,

Your Form Item should be LookUp, not Filter.

 

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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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
Users online (1,396)