cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: ComboBox Issue - will not source a default

@simms7400 

Try to hash through some of this for a bit.  I need to step away for a few hours on other business.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
simms7400
Level 8

Re: ComboBox Issue - will not source a default

@RandyHayes 

 

All of that checks out:

parent.jpg

So the highlighted portion should be displayed in the ComboBox, but it's not.

If I run this form I can view the ComboBox and it has the correct values in the drop dowm, its just not displaying the default value.

simms7400
Level 8

Re: ComboBox Issue - will not source a default

@RandyHayes 

I think it is related to my collection.

 

So to test, I added another ComboBox to the same card and used one of hte data source I currently have in my collection : "RD_Investment_List".

 

I also used the Lookup formula:

LookUp(rdActivity, Parent_Node=PFPParent)

and it is finally returning something,but not what I expect:

 

yes.jpg

 

Reason being, if I now go back out to my "rdActivity" table (the source of this form), it's returning the "name" value and not the "Parent_Node" value:

return.jpg

Either way, it's progress and I tihnk the collection is the main issue but undersure as to why..

 

Super User
Super User

Re: ComboBox Issue - will not source a default

@simms7400 

So the thing is, your Collection is only collecting the Name column value.

 

Clear(ListActParentList);
ForAll(
   Filter(RD_Investment_List, Portfolio_Status<>"Terminated"),
   Collect(ListActParentList, Name)
  );
ForAll(
   Filter(RD_Target_List,Portfolio_Status<>"Terminated"),
   Collect(ListActParentList,Name)
  )

Is this collection used for something else in your app that relies on this?

 

If not, then you can consider changing to gather more information:

 

Clear(ListActParentList);
ForAll(
Filter(RD_Investment_List, Portfolio_Status<>"Terminated"),
Collect(ListActParentList, {nm: Name, pn: Parent_Node})
);
ForAll(
Filter(RD_Target_List,Portfolio_Status<>"Terminated"),
Collect(ListActParentList, {nm: Name, pn: Parent_Node)
)

Or...to drop the expensive ForAll:

 

 

Clear(ListActParentList); 
Collect(ListActParentList, 
           ShowColumns(
               Filter(RD_Investment_List, Portfolio_Status<>"Terminated"), 
               "Name", "Parent_Node")
         );
Collect(ListActParentList, 
           ShowColumns(
               Filter(RD_Target_List,Portfolio_Status<>"Terminated"), 
               "Name", "Parent_Node")
        )

Now you will have a collection with two columns - name and parent_node - from the two sources.

 

And, using this as your ComboBox items, you'll be able to select Parent_Node as the value to display.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: ComboBox Issue - will not source a default

@simms7400 

Also, looking at your Lookup...remember, Lookup returns 1 record.  If you want to get a list of records for a combobox or any other list, you need to Filter or use any other function that returns a table. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
simms7400
Level 8

Re: ComboBox Issue - will not source a default

@RandyHayes  Thank you, Randy.

 

So I thought about that, but here's the catch, "Parent_Node" doesn't work for the (2) data sources.  Reason being, my "rdActivity" SP List has the columns "Name" and "Parent_Node", as shown in my earlier screen shot.

 

The values in "Parent_Node" of "rdActivity" can be found in either "RD_Investment_List" or "RD_Target_List" in the "NAME" column - there is not "Parent_Node" column in these two data sources.

 

Does that help clear things up?

simms7400
Level 8

Re: ComboBox Issue - will not source a default

Here is a screen shot for additional clarity on the column names:

ALL4.jpg

 

Hence, now you know why I was only trying to pull in "Name" in my collection. but, i think this is where my problem lies.

Super User
Super User

Re: ComboBox Issue - will not source a default

@simms7400 

Hmmm, no I'm a bit more confused now...Smiley Happy

 

So, then what do you want to display in your ComboBox?  If nothing was selected or anything else (in otherwords, let's not discuss selecteditems right now), what would be in the ComboBox when you drop it down?  I thought it was Parent_Node you wanted??  

The form right now is reading in all columns related to PFP-A1217500 therefore the ComboBox should be populated with PFI-00590-10159 as showns in the "Parent Node" field above.

And, if I'm reading everthing properly, your Parent_Node field is in the rdActivity list.

 

If all this is correct, then yes, the collection method is not relevant to this scenario.

Your Items property of the ComboBox should be related to the rdActivity list.  

 

BUT...the real question is this.  Do you want all of the Parent_Nodes to appear in the list and then just have the current PFPParent one selected?  Or are you looking for the list to have only the PFPParent listed and only that selected?  (which would seem a little meaningless for a ComboBox)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
simms7400
Level 8

Re: ComboBox Issue - will not source a default

@RandyHayes 

 

Ah, here is me being complicated again! Sorry, Randy - allow me explain.

 

What I want to display in my ComboBox drop down (as it already does) is a MASTER list of all "potential" parents this particalur "PFP-*" code can have (derived from the two data sources that are curently in my collection).

 

For new requests, the end user selects the appropriate "parent" from a gallery and then that selection is set into a variable called "PFPParent" which is then used in the "Parent Node" field Default propery when they are directed to this form.

 

However, later on down the road, an end user may need to change the parent. Therefore, he/she would initiate a change request and from the ComboBox drop down, select the new parent.  But either way, when an end user initiates a change request for another field (NOT the Parent) I still want the combobox to display the current value in the "Parent_Node" column of the "rdActivity" SP list.

 

Does this make sense? I'm sorry if this confused you more lol

Super User
Super User

Re: ComboBox Issue - will not source a default

@simms7400 

No problem...this is just adding a few more beers to my Boston trip LOL

I think a lot of the confusion is just in the interpretation of the requirements.

 

My wife said: "Please go to the store and buy a carton of milk and if they have eggs, get a dozen." I came back with 12 cartons of milk She said, "why in the hell did you buy 12 cartons of milk" "They had eggs"

 

Okay...let me drop back and make sure we're heading in the right direction:

New Record - From your description

 

For new requests, the end user selects the appropriate "parent" from a gallery and then that selection is set into a variable called "PFPParent" which is then used in the "Parent Node" field Default property when they are directed to this form.

This tells me that this ComboBox plays NO role in this scenario.  The user has made a selection from some other gallery.  You have captured that Parent_Node value into a variable called PFPParent and you use that variable in your default and update properties of the DataCard of the EditForm for the Parent_Node column of the rdActivity list.

 

Edit Record 

However, later on down the road, an end user may need to change the parent. Therefore, he/she would initiate a change request and from the ComboBox drop down, select the new parent. But either way, when an end user initiates a change request for another field (NOT the Parent) I still want the combobox to display the current value in the "Parent_Node" column of the "rdActivity" SP list.

Okay - let's look at this.  If I break this apart -

The List (not the selection) - the combobox will have all possible Parent_Node values in the list (dropdown).  The values in the ComboBox list come from the Name column of the RD_Investment_List and RD_Target_List (filtered by Portfolio_Status <> "Terminated")

The Selection- The current Parent_Node value from the current record in RD_Activity should be selected.  The user can change that selection. 

 

Does the above seem correct...or did I just grab a dozen cartons of milk? Smiley Wink

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 340 members 4,317 guests
Please welcome our newest community members: