cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
morall
Microsoft
Microsoft

Error adding optionset to collection

ClearCollect(varStatusDropdown, {Values: "All"});
Collect(varStatusDropdown, {Values:'OneEng Candidates'.GeneralStatus})

 

{Values:'OneEng Candidates'.GeneralStatus} is returning a table and inserting it into the "Values" column. Whereass "All" is just a text field, so I understand the error.

 

How do I add the options on an optionset to a collection? 

4 REPLIES 4
cds
Impactful Individual
Impactful Individual

Concat() them and when u unpack them, Split() them

ClearCollect(varStatusString, {Test:Concat(varStatus, Result & ", ")});

 

That turns it into a string:

 

Screen Shot 2020-07-28 at 4.05.11 PM.png

 ClearCollect(varStatusList, Split(varStatusString.Test, ","))

 

That is returning an error, saying its a datatype table. I thought .Test would return a string? 

Edit- Nevermind, I needed to select the first Item in the table and then access the Value. I was trying to access the .Test which returned a column (ie table)

cds
Impactful Individual
Impactful Individual

is that what you wanted

Hi @morall :

Is your problem solved?

If you have found a solution, please consider accept it as the solution to help others.

In addition,this problem can also be solved using forall

 

ForAll(varStatus,Collect(varStatusDropdown, {Values:Result })

 

I think this link will help you a lot:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall

Best Regards,

Bof

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,380)