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 / If statement - multipl...
Power Apps
Answered

If statement - multiple conditons

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I have created a powerapps form from my SP list.

I have a dropdown with 2 values  - "Fiche de faisabilité" and "Fiche programme"

 

When i select Fiche de faisabilité, i can input the name of my client into the name field.

But if i select Fiche programme i want to filter it or lookup

 

This is my formula

If(dpd_etape.Selected.Value="Fiche de faisabilité";ThisItem.'Nom du client';Filter(dpd_recherche_etude.Selected.Nom);Nomduclient))

 

ALP1_0-1623254986954.png

To explain what is my purpose.

I created a document library. When I upload a document (excel for example) I fill in the requested metadata.

But when I load another document (Word for example), I must be able to associate it with the excel document I just uploaded

For quality reasons, I must be able to automatically retrieve the metadata that I have filled in for the excel document.

 

 

Categories:
I have the same question (0)
  • dyee Profile Picture
    145 on at

    I think you want to be using the lookup function rather than the filter function.  I think the formula you want is something like...

     

    If( Dropdown1.Selected.Value = "Fiche de faisabilité", "", Lookup(DataSource, LookUpColumn = LookupCondition,FieldYouWantReturned).

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Please consider changing your Formula to the following:

    If(dpd_etap.Selected.Value = "Fiche de faisabilité"; 
     ThisItem.'Nom du client';
     dpd_recherche_etud.Selected.Nom
    )
    

     

    I hope this is helpful for you. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    YOU ARE AWESOME. Thank you so much

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @RandyHayes , sorry to distrub you again.

    Can you help me. I have a dropdown and my formula isn't working

     

    If(dpd_etape.Selected.Value="Fiche de faisabilité";Sort(Distinct('Base région centre';Region);Result);Filter('centre de documentation';Région=dpd_recherche_etude.Selected.Région).Région)

     

    ALP1_0-1623335376541.png

     

    I searched for hours but I didn't find anything

     

    Do you have an idea ? 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    What property are you putting that formula in??

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    When i select fiche de faisabilité, the user must select the region in the dropdown list.

    So if i use this formula it works

    If(dpd_etape.Selected.Value="Fiche de faisabilité";Sort(Distinct('Base région centre';Region);Result)

     

    But when the user selects "Program form", I want to fill the field with what was selected by the user.

    I tried several formulas but to tell the truth I'm a little lost on this second part.

     

    I tried with this -

    If(dpd_etape.Selected.Value="Fiche de faisabilité";Sort(Distinct('Base région centre';Region);Result);'centre de documentation';ThisItem.Région=dpd_recherche_etude.Selected.Région).Result

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You're mentioning the formulas, but I need to know what property of your Dropdown that you are trying to put this formula in.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Oh Sorry...it's items property.

    By the way, i suscribe to your channel and i'm watching powerapps forms plus...it's fascinating. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    ALP1_0-1623344134721.png

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    It's a long video, but well worth the time!  And thanks for subscribing!!

     

    So for your Items formula, you need to have matching schemas.

    If(dpd_etape.Selected.Value="Fiche de faisabilité";
     Sort(Distinct('Base région centre';Region);Result);
    
     RenameColumns(
     Filter('centre de documentation';Région=dpd_recherche_etude.Selected.Région).Région;
     "Région"; "Result"
     )
    )

     

    The first part of your If is returning a table with a single column called Result.  In your formula, you had the second part returning a table with a table with a single column called Région.

    In the above formula, both conditions will not return tables of compatible schemas.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard