cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Taniwha
Level: Powered On

Stumped Complex fields in Display Forms on Multiple Record Selections

Ok I am stumped.  Let me outline the App and Problem.

 

APP

1. Pulls data a SharePoint Online List of all our Projects

2. Designed for self service updates to Non-Project Managers on Projects - so Display/View Only, No EDIT capabilities needed.

3. User navigates to Portfolio List (Gallery) -> Project Details (Display Form) - examples attached

 

PROBLEM

1. As you can see in the App the Project Details (Display Form) has displayed the data 100% correctly for every field (the FIRST time you select a Project on the Portfolio List (Gallery).  So as yet looks great the first selection, in this case ID 49 on the attached screen shot. 

2.  Problem occurs when I go back in the same session, and choose a new Project selection from Portfolio List (Gallery), and then go look at the Project Details (Display Form), as you can see in example this is ID 8 on the screen shot.  

3. The problem with any second and subsequent selection is my Complex fields (Choice, Person) are not displaying the correct ID 8 data but rather the data from the very first record selected in the session, in this case ID 49.

4. However you can see that all other fields such as the Text, Dates, Long Text are showing the correct details for record ID 8,

5. So in short, Complex fields not correct values - everything else - awesome!

6. Now if I exit App, start a new session and select a new Project to start, it displays that record correctly, lets say it was ID 99.  But again every subsequent selection shows the Complex fields for values in ID 99, but again the correct non-Complex data fields for that selected record.

7, Oddly when I Preview/Test the App from within the App Editing tool it all works without issues.  Its only when its Published and you access from either Phone App, or Web.

 

ASSESSMENT

In my own tests I did the following:

1. Built a new basic list, and used the built in App Creator to create the App.  Same problem.  So its not the list, and the out of the build has same issues.

2. If I look at the values in the properties for this examplse, lets use the field called ChoiceField in SharePoint

ChoiceField_DataCard

    DATAFIELD: "ChoiceField"

    DEFAULT: ThisItem.ChoiceField

DataCardValue is using:

    ITEMS: Choices(<ListName>.<Field>)

    DEFAULT: 

    DEFAULTSELECTEDITEMS. Parent.Default

 

I have seen posts regarding the quirks of using the Data Form for Complex fields, but I have seen many video posts that show this working fine such as on PowerApps911 or other channnels, so I am left with wondering why something seeming so straightforward is giving me grief.

 

Any help would be much appreciated

 


Accepted Solutions
Super User Rank
Super User

Re: Stumped Complex fields in Display Forms on Multiple Record Selections

Hi @Taniwha,

I don't use person, choice or lookup type columns when I design with SharePoint for the reasons that I go over in my blog posts in the Community Blog. Relational-Database-Principles-and-PowerApps-Step-3-Keys-and relationships As an alternative, I suggest using Single line of Text instead of choice. You can easily load a dropdown control in PowerApps with ["Choice1", "Choice2", "Choice 3"]  if there are only a few choices, when there are more, make another list and use that to load the dropdown.  

Instead of Lookup type fields to deal with one to many relationships, I use a number type column instead.  I then use a second list and save the ID as a foreign key in the first list, for example SecondListID.  You would have a dropdown control in the Edit form inside of the card holding the SecondListID.  The dropdown would have the Items property SecondList,  and you would set the Update property of the card as Dropdown.Selected.ID.  Then in galleries or anywhere else you wanted to display the name from the SecondList,  you would use the Lookup(SecondList, ThisItem.SecondListID = ID, ItemName).  


All Replies
Taniwha
Level: Powered On

Re: Stumped Complex fields in Display Forms on Multiple Record Selections

I do have a temporay work around - which seems odd but

On the Portfolio List (Galley) option, if I add whats in RED to Refresh the data as its transitioning to the ProjectDetailScreen1 to OnSelect property: Navigate(ProjectDetailScreen1, ScreenTransition.UnCover);Refresh('Portfolio Status')

 

It moves to the Detail Screen and updates the Complex fields to the correct data.

 

I doubt this is the problem, but perhaps someone has a less data loading fix.

Super User Rank
Super User

Re: Stumped Complex fields in Display Forms on Multiple Record Selections

Hi @Taniwha,

I don't use person, choice or lookup type columns when I design with SharePoint for the reasons that I go over in my blog posts in the Community Blog. Relational-Database-Principles-and-PowerApps-Step-3-Keys-and relationships As an alternative, I suggest using Single line of Text instead of choice. You can easily load a dropdown control in PowerApps with ["Choice1", "Choice2", "Choice 3"]  if there are only a few choices, when there are more, make another list and use that to load the dropdown.  

Instead of Lookup type fields to deal with one to many relationships, I use a number type column instead.  I then use a second list and save the ID as a foreign key in the first list, for example SecondListID.  You would have a dropdown control in the Edit form inside of the card holding the SecondListID.  The dropdown would have the Items property SecondList,  and you would set the Update property of the card as Dropdown.Selected.ID.  Then in galleries or anywhere else you wanted to display the name from the SecondList,  you would use the Lookup(SecondList, ThisItem.SecondListID = ID, ItemName).  

Taniwha
Level: Powered On

Re: Stumped Complex fields in Display Forms on Multiple Record Selections

Thanks Drrickryp. From what I saw elsewhere I expected that may be the answer.  For now, I will leave with the work around, and oddly as I did create an Edit option for the PMs to update some of there fields the work around to Refresh the details screen so far seems to work on View and Edit.  

 

Unfortunately the App is populated from both PowerApps and in SharePoint directly which given some time I could re-engineer around the lines you laid out.  Ill keep in mind for future.  Thanks for the suggestions.