I will try to explain this as best as I can so it isn't too confusing. I'm trying to design an app that's using records/creating records in multiple sharepoint lists. I have looked up information on how to create relationships between my table but it seems I need to add the relationship entity, which I am blocked from doing by the Admin. Failing that I was going to try and use variables. Not as good I know but I am not sure what to do to work around it, and I am very new to PowerApps. I don't think I will be given the rights to add the relationship entity. Just a note the relationships would always be one to one (one project ID will only ever have one record on each table I mention below) related by the ProjectID.
I have the following sharepoint lists: Projects, SectionSelect, Section 1, Section 2.
On Screen1 I have a gallery of the Projects data source. I have a button that when selected it sets a variable of the ProjectID and Navigates to Screen2 which has a form with SectionSelect data source on it. This works fine, however, what I'm trying to do is if there is already a record in SectionSelect for this project ID, that it instead goes to Screen3, which will have multiple forms on it for Section 1 and Section 2 data sources.
If my button on Screen 1 is just setting the Variable and Navigating to Screen 2 it works fine, but when I try to add the IF statement into it, it all goes wrong, it's not recognizing the variable in the IF, presumable because it's all happening within the one statement? Maybe I'm just not putting things in the correct order or writing them properly.
Can anyone tell me if there is another way around relationships? If this will work and if so maybe how to write that code for that button?
Thank you in advance for your time and thoughts.
Solved! Go to Solution.
Hi, Not sure what was going on but, I removed the column ProjectID in the SSD section Table, re-added it but renamed it ModusID, then updated the code and it worked. It is now swapping screens. However I still get the delegation warning. This is my updated code.
Set(vProjectID,ThisItem.'Project ID'); If(CountRows(Filter('Test - SSD Sections',ModusID = ThisItem.'Project ID'))=0, Navigate(SSDSectionPick,ScreenTransition.Fade),Navigate(SSD, ScreenTransition.Fade))
Both the SSD SectionPick screen and SSD screen are blank in the On Visible as I hadn't attempted to figure out how to show the related data since I was having trouble with the above code. So obviously then it isn't showing data from the two tables on those layouts not knowing what to show.
I think this should sort your delegation issue
Set(vProjectID,ThisItem.'Project ID'); If( IsBlank( First( Filter('Test - SSD Sections',ModusID = ThisItem.'Project ID') ) ), Navigate(SSDSectionPick,ScreenTransition.Fade), Navigate(SSD, ScreenTransition.Fade) )
Hope this helps.
Check out the on demand sessions that are available now!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Features releasing from October 2020 through March 2021
Check out the Power Platform Community Highlights