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 / Dropdown list with If ...
Power Apps
Answered

Dropdown list with If statement

(0) ShareShare
ReportReport
Posted on by 276

 I'm having an issue that i cant work out whereby i want some logic with a dropdown list to show the items from a collection IF the collection has any data in it and if the collection is empty then i would like it to show something else ie ["1","2"].  My formula is below,

 

 

If(!IsEmpty(ColPlotPermission),ColPlotPermission,["1","2"])

 

 

I am getting this error... "Warning: The Columns produced by this rule are all nested tables and/or records, however the property expects at least some columns of simple values (such as text or numbers)" (See pic attached)

What is strange is that if i just input the following into the items property of the dropdown

 

If(!IsEmpty(ColPlotPermission),ColPlotPermission)

 


 my dropdown shows the Result column of ColPlotPermissions collection as it should.

also if I input "["1","2"]" into the items property then my dropdown box shows 1 and 2 as you would expect.  

i seem to have an issue with when i add the "," to the If statement and the else value (which at the minute i'm just trying the basic "["1","2"]" and its throwing an error.?

Any thoughts? i've played around with this for ages to no avail! 😞 

 

FYI - My ColPlotPermission collection just has one Column called "Result" (See pic attached)

Captureerror.JPG
Capture.JPG
Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @d3ell 
    ColPlotPermission is a set of tables.  Do this...

    If(!IsEmpty(ColPlotPermission),ColPlotPermission.Result,["1","2"])

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • d3ell Profile Picture
    276 on at

    thanks for your reply, however I had tried that already.

     

    See attached, same issue 😞

     

    Capture2.JPG
  • mdevaney Profile Picture
    29,991 Moderator on at

    @d3ell 
    Please show me what your collection ColPlotPermission looks like in a screenshot using the CollectionViewer 🙂

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • d3ell Profile Picture
    276 on at

    Hi, Its attached to the 1st post. If you cant see it let me know and i'll post again

    Not Sure if its got something to do with the column name being result?

     

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @d3ell 
    I figured it out.  Yes, its because there are 2 different column names: result and value.  There can be only one.

    If(!IsEmpty(ColPlotPermission),RenameColumns(ColPlotPermission,"Result","Value"),["1","2"])

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • d3ell Profile Picture
    276 on at

    Hi thanks!

    that has worked for my simplified scenario.... however (sorry!) when i add in the other collection that i want to use instead if the Collection is empty i get the same error.

     

    So how  i want it to work is that if 'ColPlotPermission' is empty the dropdown is filled from the other collection 'ColAllPlots' - I jave tried to use your format and just keep the value as the column name, but its throwing up the same twin blue line and yellow triangle with the error - Pic attached.

     

    Formula below.

    If(!IsEmpty(ColPlotPermission),RenameColumns(ColPlotPermission,"Result","Value"),RenameColumns(ColAllPlots,"PlotNo","Value"))

     

    i must note though that it appears to work above, however i'm just sceptical of the yellow triangle

     

    I have attached a picture of the 'ColAllPlots' collection as well.

    Thanks for your help!

    Capture5.JPG
    Capture4.JPG
  • mdevaney Profile Picture
    29,991 Moderator on at

    @d3ell 

    Sorry, that's all the help I can offer for now.  If you have another question, please make a new post.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • d3ell Profile Picture
    276 on at

    Ok thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard