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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dropdown list with If ...
Power Apps
Unanswered

Dropdown list with If statement

(0) ShareShare
ReportReport
Posted on by 274

 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)

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 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
    274 on at

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

     

    See attached, same issue 😞

     

  • mdevaney Profile Picture
    29,989 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
    274 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,989 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
    274 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!

  • mdevaney Profile Picture
    29,989 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
    274 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard