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 / Combo box: SelectedIte...
Power Apps
Unanswered

Combo box: SelectedItems, convert string to a combobox

(0) ShareShare
ReportReport
Posted on by 254

Hii, I have combo box: ["","SOX-DOC", "QA-DOC", "QA-AP", "QA-PG"]. 

 

Actually what I need is convert string to a list for combobox.

 

So my string now is N/QA-DOC/SOX-DOC; comment. So I need to get from it ["QA-DOC", "SOX-DOC"], because it should shown in combo box: DefaultSelectedItems

1)I am splitting string and get substrings "N/QA-DOC/SOX-DOC", "comment" and I am working  with "N/QA-DOC/SOX-DOC"

2) I am getting "QA-DOC/SOX-DOC"

What is my next step? to do from "QA-DOC/SOX-DOC" ---->  ["QA-DOC", "SOX-DOC"]

 

Categories:
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    HI @Aleksandra1 ,
    Try using below formula in Items property of combobox - 

    LastN(Split(First(Split("N/QA-DOC/SOX-DOC; comment",";")).Result,"/"),2)

  • Aleksandra1 Profile Picture
    254 on at

    I see you wrote 2 in the end, it means that I need to extract two last substrings?

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Yes as it was giving me 3 strings starting with - "N", "QA-DOC" and "SOX-DOC".
    LastN will extract last 2 from the above outptut 

  • Aleksandra1 Profile Picture
    254 on at

    So I have already code for it, where I don not define number, because string can be different 
    codeforerrorcodes.png

    Output of this code is string "QA-DOC/SOX-DOC", it looks like I need only to add Split function Split("QA-DOC/SOX-DOC", "/") and I should get result in combobox, but I get nothing. I don;t know why

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Try using below formula in the true condition part of your formula (if ";" is there in the string) from 7th line in the formula - 

    LastN(Split(First(Split(ThisItem.'PO attached', ";")).Result,"/"),2)

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 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard