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

Gallery Dropdown, Collection values Selected Item

Greetings,

 

I have a canvas app with a gallery that is tied to a Sharepoint list that is populated from a MS Form.  The Gallery has labels for most of the values, but I want one of them to be a status dropdown with a set of options - Pending, Approved, Rejected(the options on the MS Form).  How can I have the dropdown show those values, but display the value that is in the Sharepoint list?  I tried setting the Items to able({Status:"Pending"},{Status: "Approved"},{Status:"Rejected"}) and the Default to ThisItem.Status but it always shows the first item in the list - Pending.  Should I create a Sharepoint list for these status instead?  Then point the dropdown to that list for possible options?  In which case, I would still need to know how to display the value from the form.  I need this to be a dropdown so the user can update the status and save.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Hello,

 

Here's an idea that should hopefully do the trick. If your "Status" field in SharePoint is a choice field, then for the drop down inside your gallery, have the Items property set to this: Choices(ListName.Status) 

 

Then, for the Default property of your drop down, have it set to this: ThisItem.Status.Value

 

Lastly, for the OnChange property have it set to something like this: Patch(ListName,ThisItem,{Status:{Value:Dropdown1.Selected.Value}}). Since you're using a choice column, I'm assuming, you'll need to add the {Value: Dropdown.Selected.Value} inside of the {Status: } as you can seen in the formula. 

 

Does this help? If you're using a string field, it should be very similar, except you'd have to put in something like ["Pending","Approved","Rejected"] for the items property like you were saying. But if you can't figure it out just let me know! 

 

Hope this solves it for you! 

 

Kind regards,

Ben Fetters

www.sovereignsp.com

If this solved the problem for you, feel free to hit "Accept as Solution" so others can find the answer easier. 🙂

Kind regards,

Ben Fetters
Power Apps/Power Automate Developer
www.sovereignsp.com

View solution in original post

6 REPLIES 6
Highlighted
Resolver V
Resolver V

Hi,

 

I would create a SharePoint table and also I would have the Forms data sent to SharePoint through using flow this way all is in your data repository.

 

If you want you can send me an email and I will setup a teams session to help further if you like. Jay@research-Nest.com

Highlighted
Continued Contributor
Continued Contributor

Hello,

 

Here's an idea that should hopefully do the trick. If your "Status" field in SharePoint is a choice field, then for the drop down inside your gallery, have the Items property set to this: Choices(ListName.Status) 

 

Then, for the Default property of your drop down, have it set to this: ThisItem.Status.Value

 

Lastly, for the OnChange property have it set to something like this: Patch(ListName,ThisItem,{Status:{Value:Dropdown1.Selected.Value}}). Since you're using a choice column, I'm assuming, you'll need to add the {Value: Dropdown.Selected.Value} inside of the {Status: } as you can seen in the formula. 

 

Does this help? If you're using a string field, it should be very similar, except you'd have to put in something like ["Pending","Approved","Rejected"] for the items property like you were saying. But if you can't figure it out just let me know! 

 

Hope this solves it for you! 

 

Kind regards,

Ben Fetters

www.sovereignsp.com

If this solved the problem for you, feel free to hit "Accept as Solution" so others can find the answer easier. 🙂

Kind regards,

Ben Fetters
Power Apps/Power Automate Developer
www.sovereignsp.com

View solution in original post

Highlighted

**EDIT**  Once I closed my browser and reloaded everything, the dropdowns worked correctly.  Thanks!

 

Hi Ben.  Thanks for the detailed response.  I am a developer, but new to Power Apps, so some of this makes sense.  Here is where I need some clarification...

 

I updated the dropdown Items property to Choices(MySharepointList.Status).  That showed the values one can choose for that Status field.  Then I set the default property to ThisItem.Status.Value.  Then I set OnChange property to

 

Patch(MySharePointList,ThisItem,{Status:{Value:ddlEditStatus.Selected.Value}})

 

 

I must be missing something because it does show the available choices, but it does not update when I go to a new record.  It always shows the first status - Pending.  I have a dropdown outside this gallery that also shows these Status and when the user selects a status  it filters for all those records that have that status.  When I select "Approved" it shows the approved items in the gallery, but all of the ddlEditStatus still display Pending.  What am I missing?

 

Thanks again!

 

Highlighted
Continued Contributor
Continued Contributor

I'm glad the first part worked!

 

That is interesting though. what I like to do, just to make sure the filter is working, is add a label in the gallery that just shows the status of each item. I'm sure the filter is working, but maybe just in case.

 

Then, you could try deleting the drop down and re-adding it to the gallery. Is it possible you're using a combo box instead of a drop down? 

If this solved the problem for you, feel free to hit "Accept as Solution" so others can find the answer easier. 🙂

Kind regards,

Ben Fetters
Power Apps/Power Automate Developer
www.sovereignsp.com
Highlighted

@BenFetters , it worked...just had to close everything out and open it again.  Not sure why it only partially work until I closed things out, but all is well that ends well!  Thanks again for the assistance.

Highlighted
Continued Contributor
Continued Contributor

Oh okay, haha who knows why sometimes it doesn't work! But that's great! Glad it's working!

If this solved the problem for you, feel free to hit "Accept as Solution" so others can find the answer easier. 🙂

Kind regards,

Ben Fetters
Power Apps/Power Automate Developer
www.sovereignsp.com

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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