cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerStar321
Helper I
Helper I

Setting Combo box default item from a parameter in a url

Hi All,

 

I have two PowerShell Apps, App1 and App2. After pressing the submit button on App1 it lunches to App2 with a parameter within the Url called Parm001.

 

Launch(Concatenate("https://apps.powerapps.com/play/4807...%201)?ID=123&Parm001=",TextInput1.Text)

 

App2 has a combo box with data from a SharePoint list column. The combo box item is set to:

 

Choices([@'External User Access Request Form'].Project_x0020_Site)

 

App2 also sets a variable called TestVar2 with the text from the parameter Parm001 within onStart.

 

Set(TestVar2,Param("Parm001"))

 

I have placed a label on App2 and set the text to TestVar2 to view the parameter text and this works OK.

 

My question is, how do I set the combo box on App2 so its default item is set to Parm001 value?

 

I have tried [Parm001] but when I press the submit button on App2 it doesn’t add this to the SharePoint list. I think this is because it changes the Combo box default text but doesn’t select the item in the combo list.

 

I hope this makes sense to you. At the beginning of the week, I had a full head of hair, I am now bald from the stress this is giving me.

 

I hope you can help. Thanks
Colin

1 ACCEPTED SOLUTION

Accepted Solutions

The below formula for the DefaultSelectedItems property worked for me:

 

LookUp( Choices([@listname].lookupcolumn) ,Value=Label1.Text)


Thanks for all your help

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@PowerStar321 

If this is really a combobox, then set the DefaultSelectedItems property to : 

   {Value: Param("Param001")}

 

I hope this is helpful for you.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too!

Hi RandyHayes,

 

This partially worked. It automatically gave the combo box the default value of parameter, but when I pressed submit the parameter text doesn't showup the SharePoint item column.

 

This column is a lookup column and within PowerApps the combo box items is set to

 

Choices([@'External User Access Request Form'].Project_x0020_Site)

 

Capture.PNG

 

I hope you can help

Colin

RandyHayes
Super User III
Super User III

@PowerStar321 

So that is, I believe, a somewhat separate issue than your original.  Your original was how to get the parameter passed and set the defaultselectedItem.

This now has to do with saving that to your list.

Tell me more about the submit button....is this in an EditForm or something else?  If it is an edit form, what is the Update property of the datacard that contains the combobox?  And, you mention the underlying column is a Lookup column...please clarify.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too!

The below formula for the DefaultSelectedItems property worked for me:

 

LookUp( Choices([@listname].lookupcolumn) ,Value=Label1.Text)


Thanks for all your help

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (43,899)