cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MityaF19
Level: Power Up

Data across multiple screens New or Existing info

I have a Sharepoint list as my data source and and I'm developing an Interview App which currently has 3 screens:

1. Home screen - Fairly standard Gallery that shows a list of past interviews and has an option to add a New record.

2. An Initial Assessment - A screen for the interviewer to record key details and an initial view against 14 set criteria.

3. An Interview Record - The form that is used during the interview to record data

 

To view info from a previous interview the app works wonderfully. I select the record on the Home screen it Selects(Parent) and navigates to the Initial Assessment screen (with the original assessment) and from there I'm able to navigate to the Interview Record. On both screens 2 and 3 the edit forms data source is set to the SP list and the item to GalleryX.Selected (where GalleryX is on screen 1). And this is, I suspect, why I'm having problems when I try and add a new record.

 

When I select to add a new record from Screen 1 it takes me to a blank Initial Assessment (as planned) but when I submit it  (SubmitForm(IAForm); Navigate(screen3, none) ) It takes me to the 3rd screen but shows me data from the last submitted record rather than the data submitted relating to the new record. I do think this is because the Form on Screen 3 has its Item set to GalleryX.Selected but please tell me if you know otherwise. The new Initial Assessment is actually recorded in my List,so I know the SubmitForm is working it just isn't displaying it on screen 3. When I return to Screen 1 it is on the list.

 

So how should I go about ensuring that the data shown and recorded shows New records if that is the route I take or the selected record otherwise.

 

Sorry about the rambling, I'm fairly new to PowerApps and I'm sure that I've fallen down a number of elephant traps on my adventures.

2 REPLIES 2
Highlighted
yshariff
Level: Powered On

Re: Data across multiple screens New or Existing info

When working with forms and galleries, I find using gallery.selected for the forms items can cause issues with showing wrong records and not working as expected. What I do is on the gallery's on select, I set a global variable for that records ID. Example:

 

Set(varCurrentRecord, ThisItem.ID)

 

Then you set you forms item property to LookUp(YourSharepointList, ID = varCurrentRecord). You should also add to the gallery's on select: EditForm(YourFormsName). That way it sets to edit mode. When you want to create a new record, make sure you use NewForm(YourFormsName).

 

Now when you create a new form and want your screen 3 to show that new form, you should update the form from screen 2 "On Success" to Set(varCurrentRecord, YourFormsName.LastSubmit.ID). This will update the global variable with the new records ID. 

Microsoft v-siky-msft
Microsoft

Re: Data across multiple screens New or Existing info

Hi @MityaF19 ,

This issue is easy to understand, because when you submit the new record, you don't return to galleryx to select the new-created record, so the galleryx.selected won't be the new submission you expect.

The workaround is to pass the item by variable.

  • Set OnSelect of GalleryX : Set(Var_selected, ThisItems.ID)
  • Set Items of Form in screen2: LookUp('SP list', ID= Var_selected)
  • Set OnSuccess of IAForm:  Set(Var_selected, IAForm.LastSubmit.ID)
  • Set Items of Form in screen3: LookUp('SP list', ID= Var_selected)

please have a try and check if your issue is fixed.

Best regards,

Sik

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,812)