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

Adding Collection DropDown data to a SharePoint list

PowerAppDropdownCollection.jpg

I have an app which uses a SharePoint list. Two of the fields are Choice, as defined by SharePoint to provide a list of options. I've noticed that even though the list only has 5 or 6 options, it still takes a few seconds to load. I thought that using a Collection along with a drop-down list would be more efficient. I figured out how to create a Collection and made a nice hidden screen to add/delete drop-down options. All that works well. But I can't figire out how to get the output from the drop-down field to update my SharePoint list in the Cloud.

 

Note, in the example above, Disposition is already a Choice field in SharePoint, so I didn't want to step on that. For my new Disposition field at the bottom of the screen, I am trying to popule ShopExt temporially, which is a non used standard text field right now. I want to send the output from the lower drop-down to my SharePoint list, along with the other fields on the screen. All the other fields populate their respective fields in my SharePoint list. But I can't get ShopExt to work. Not getting any errors. Am I missing something in naming the fields. My Collection is titled Dispositions and has five text entries.

8 REPLIES 8
Community Support
Community Support

Hi @JimmyS,

 

So you are having issues update the choice field in SharePoint list with customized Dropdown (using collection)?

If this is the issue, then please take a look at the following article:

How to patch SharePoint List Lookup field, such as people, choice, or the custom Lookup column type

Which would show you how to use the patch function to update the lookup field.

And if you need any further help on this, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Champion
Community Champion

@JimmyS

 

You might want to consider the following option: 

  • Make Sharepoint column just a "Single Line of Text" type rather than Choice
  • Set your dropdown.Items Property to ["any", "option", "you", "want"]
  • Set your dropdown.Update Property to dropdown.Selected.Value

I find things easier if I control the dropdown options IN PowerApps rather than in Sharepoint. May be something for you to explore. 

 

Take care

Responsive Resident
Responsive Resident

Hi @ericonline @JimmyS @v-micsh-msft 

I tried the same as you said it did work however, that only updated single item name, but here im trying to update the whole collection. do you know is its possible or not? If yes can you bit give an example of updating dropdown collection to sharepoint list ? please this would be a great help for me. 


Thanks a lot

Please provide more details.

 

When you say "I'm trying to update the whole collection", do you mean:

1. You want to update the collection with the Dropdown value

2. You want to update a single Sharepoint column with all values in a collection?

Responsive Resident
Responsive Resident

Hi @ericonline @v-micsh-msft 

I'm trying to update the collection value to my sharepoint list column named GL Code, but unable to update the dropdown values, the dropdown value is added to the collection, but not updated in the column in SharePoint, can anyone please let me know what m i doing wrong? as I can see that the other values are being updated but the only dropdown value is not been updated to my SharePoint list.

 

I don't know what is the reason or the error, as I there are no such warning which I can see. 

Please see the code below for the reference. 
Please let me know if anyone has the right solution to this. 

Also the dropdown column in sharepoint list is single line text, and in power apps it is data card with dropdown, 
Untitled.png

 

 

 

On success property of form

 

 

ForAll(
    GLItems,
    Patch(
        PettyCashTesting,
        Defaults(PettyCashTesting),
        {   
            Title: User().FullName,
           'Day total': Value(TotalItems),
            'GL codes': Value(Items)
       }
    )
) ;

Navigate(SuccessScreen, ScreenTransition.Fade);

Clear(GLItems);

 

 

 

 

 

 

On Items filed of Dropdown:

 

 

 

 

 

[ "Blank", "1. Bank Charges", " 2. Bus Transport", " 3. Equipments", " 4. Cleaning and Household", " 5. Housekeeping", " 6. Heat", " 7. Sports", " 8. Medical First Aid", " 9. Postage", "Others"]

 

 

 

 

 

On the select property of add button:

 

 

 

 

Collect(GLItems,
{
GItems: Text(Dropdown2.Selected.Value),
TotalItems: DataCardValue18.Text
});

 

Untitled.png

 

 

Hi @Tapesh  ,

 

Take a look at this thread , this might help you. 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Forall-Patch-issue/td-p/568058

Responsive Resident
Responsive Resident

@Gautham001 

Hi Gautham, 

Thank you so much for the help, 

Somehow this did solve the issue but i m not getting the selected values, I know have got the default value.

please have a look at the form code of the collection which i just have modified as per the post you have shared. and also the screenshot of the sharepoint list which has duplicates and not the required values 

Untitled.png

Image of the items added to collection are shown in the gallery below the forImage of the items added to collection are shown in the gallery below the for    

Collection Code changed :

ForAll(
    GLItems,
    Patch(
        PettyCashTesting,
        Defaults(PettyCashTesting),
        {   
           Title: "",
           'Day total': Value(TotalItems),
            'GL codes': Dropdown2.Selected.Value
       }
    )
) ;

 

thanks 

 

 

 

 

 

Responsive Resident
Responsive Resident

Thanks @Gautham001 @ericonline 

I have got the solution, i just tried something with collection and the following formula worked fine for me. 

 

Thanks for the help.

ForAll(
    GLItems ,
    Patch(
        PettyCashTesting,
        Defaults(PettyCashTesting),
        {   
           Title: "",
           'Day total': Value(TotalItems),
            'GL codes': GItems
        }
    )
) ;

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (20,410)