web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Pass selected items fr...
Power Apps
Answered

Pass selected items from listbox as parameter to restful webservice

(0) ShareShare
ReportReport
Posted on by 36

Is it possible to get all selected items from a Listbox control as table?

 

For example, I have a web-api that is expecting the following object:

 

{

    userIds: []

}

 

UserIds is an array/table. Than I've a ListBox which contains items of the following structure:

 

{

    "value": "..."

    "userId": "..."

}

 

Now I want to call a web service on a button click and pass all selected user. For example:

 

MyApi.SampleSendDocument({DocumentId: document.Id, Comment: SendCommentTextInput.Text, UserIds: UserListBox.SelectedItems.UserId}); Back()

 

But this is not working. I've tried a lot but could not figure out how to do this.

 

Thank you all!

Categories:
  • BenediktE Profile Picture
    36 on at

    Any news here?

  • Verified answer
    rgruian Profile Picture
    Microsoft Employee on at

    PowerApps does not support "arrays". The closest data structure in PowerApps would be a single-column table. If your Web API currently expects UserIds:[value1,value2,...], which is an array, you will need to change the endpoint so it instead expects a column UserIds:[{UserId: value1}, {UserIId: value2}, ...].

     

    Then your formula should work:

     

    MyApi.SampleSendDocument({DocumentId: document.Id, Comment: SendCommentTextInput.Text, UserIds: UserListBox.SelectedItems.UserId}); Back()

     

    I hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard