cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Custom Cards unable to display Selected Gallery Record in EditForm

I am building a new Power Apps from Blank, connecting to a SQL Database. I am redesigning the default cards to custom, for example creating a drop down with Item choices and setting the Item property to ["Option 1","Option 2","Option 3"]. I am then re-adding the default card and changing default to dropdown1.selected.value so the data gets saved back to SQL. All of that works great. The issue I run into is when I try and use the EditForm Control. Once I click edit, the data in the custom cards dissapears). 

 

I have tried setting the default to the following (that i remember). But nothing seems to work.  

  • Gallery1.Selected;
  • Parent.Default;
  • lookup (datasource, Item Choice=Gallery1.Selectd.ItemChoice)

I have attempted updating the Update control for the card but that also didn't do anything. I can't seem to find any recommendations online.

 

I am assuming the reason the data is not showing is because it's a custom card and since it's not connected to the data it won't display but I cannot figure out a formula that will work. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

This might give you a hint to continue

OnSelect of my Gallery: ClearCollect(colSelectedrow,{Value: LookUp('Master Test', ID = Gallery1.Selected.ID,Title)})

DefaultSelectedItems of my combobox : colSelectedrow.Value

View solution in original post

Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

if you have multiple columns, then don't specify the column name in the lookup. use ClearCollect(colSelectedrow,{Value: LookUp('Master Test', ID = Gallery1.Selected.ID}) this will return the entire record and save it to a collection. then you can get the value by using colSelectedrow.Column1 or colSelectedrow.Column2 , etc 

 

with the dropdown, the process is the same, but you need to set the Default property of the dropdown. dropdowns don't have DefaultSelectedItems propery.

 

---------------------------------------------

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

View solution in original post

9 REPLIES 9
Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

So you are just using that dropdown to populate another TextInput, and that TextInput is connected to your data, correct?

in this case you are not saving the combobox selected value anywhere, so none of the formulas that you mentioned is going to work.

Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

This might give you a hint to continue

OnSelect of my Gallery: ClearCollect(colSelectedrow,{Value: LookUp('Master Test', ID = Gallery1.Selected.ID,Title)})

DefaultSelectedItems of my combobox : colSelectedrow.Value

View solution in original post

Highlighted
Microsoft
Microsoft

Re: Custom Cards unable to display Selected Gallery Record in EditForm

@Edwin-Abdalian The data gets saved to an additional column by making the default =dropdown.Selected.Value which saves it to the database and that specific column. So The system column is calling the dropdown to save the data if that makes sense. 

Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

yes, please try the formula in my previous post. you need to map the text value that is saved in your SQL table, back to the choices in your dropdown

Highlighted
Microsoft
Microsoft

Re: Custom Cards unable to display Selected Gallery Record in EditForm

@Edwin-Abdalian  Thanks so much this worked! A couple of follow up questions.

 

I have multiple combo boxes but the OnSelect Gallery seems to only allow for one or do I have to separate each with a semi colon and add each column individuall? So something like ClearCollect(colSelectedrow,{Value: LookUp('Master Test', ID = Gallery1.Selected.ID,Column1)}) ; ClearCollect(colSelectedrow,{Value: LookUp('Master Test', ID = Gallery1.Selected.ID,Column2)}) ? 

 

Also does this work with dropdowns as well?

Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

if you have multiple columns, then don't specify the column name in the lookup. use ClearCollect(colSelectedrow,{Value: LookUp('Master Test', ID = Gallery1.Selected.ID}) this will return the entire record and save it to a collection. then you can get the value by using colSelectedrow.Column1 or colSelectedrow.Column2 , etc 

 

with the dropdown, the process is the same, but you need to set the Default property of the dropdown. dropdowns don't have DefaultSelectedItems propery.

 

---------------------------------------------

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

View solution in original post

Highlighted
Microsoft
Microsoft

Re: Custom Cards unable to display Selected Gallery Record in EditForm

Thank you so much! Been trying to figure out a solution for multiple days and couldn't find anything online.
Highlighted
Microsoft
Microsoft

Re: Custom Cards unable to display Selected Gallery Record in EditForm

@Edwin-AbdalianI have a follow up question. It seems to be working, however I have data coming in from multiple sources. So one source ClearCollect(colSelectedRow,{Value:LookUp('[DATASOURCE1]',Id=Gallery1.Selected.Id)}). With that the data formula. The dat cards that are linked to a different database show [Object].[Object] when I click edit. I am just assuming it's because that datasource isn't included in the ClearCollect?

Highlighted
Solution Supplier
Solution Supplier

Re: Custom Cards unable to display Selected Gallery Record in EditForm

what does the collection return? is there a record in it?

the approach shouldn't be different if you have multiple datasources. but without seeing some screenshots or your App it's hard to tell. This is what I understood from your question, correct me if I'm wrong:

  1. Dropdown1--->(Connects to DataSource1)--->(populates TextInput1) , Then TextInput1---> (Gets patched to MainList.Column1)
  2. Dropdown2--->(Connects to DataSource2)--->(populates TextInput2) , Then TextInput2---> (Gets patched to MainList.Column2)

in Form Edit mode, you need to map the value in TextInput1 to Dropdown1 , and TextInput2 to Dropdown2, by using a collection that we talked about earlier.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,655)