Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

IF Statement not working

(0) ShareShare
ReportReport
Posted on by 227

Hi,

 

I am trying to write an if statement to populate the 'Event Start Date' from my 1st list('Event Information'). I have two lists. List1('Event Information') is a parent list and List2('Checklist Details') is the child list. It is a one to many relationship between the two and the ID from 'Event Information' matches the title within 'Checklist Details'. I want to pull the 'Event Start Date' from my 'Event Information' list. However, I keep getting the following error. 

 

Please help! I am a beginner with these formulas

 

NPatel12498_0-1698074166425.png

 

  • NP-18101421-0 Profile Picture
    227 on at
    Re: IF Statement not working

    Tried both of these and it doesn't work.

     

    I also think the requirements may have confused you.

     

    If the Event Information. ID = Checklist Details. Title then pull the Event Information. Event Start Date for the current ID.

     

    The formula is within a text input box within a gallery. 

  • realwillwright Profile Picture
    772 Super User 2025 Season 1 on at
    Re: IF Statement not working

    ok, so the formula should be

    Lookup('Event Information', ID = Value(Title)).'Event Start Date'

     This again might not work very well with SharePoint lists as both lists have the columns ID and Title.

     

    If that is the case you might have to create a collection and rename some of the columns

    ClearCollect(
     colEventInformation, 
     RenameColumns(
     'Event Information', 
     "ID", "EventId", 
     "Title", "EventTitle"
     )
    );
    Lookup(colEventInformation, EventID = Value(Title)).'Event Start Date'
  • vivekravi Profile Picture
    241 on at
    Re: IF Statement not working

    Exactly, This will pull up the entire record not just the Even start date, for the filter criteria. What we need is a field value, not a record.

  • NP-18101421-0 Profile Picture
    227 on at
    Re: IF Statement not working

    The formula should only pull one record from Event Information because Event Information is the parent list whilst Checklist Details is the child list. The formula should be If the Title of the current item matches the ID from the Event Information List, then populate the Event Start Date.

  • vivekravi Profile Picture
    241 on at
    Re: IF Statement not working

    I think the issue is, since you have a one:many relationship, it is giving you an entire table, instead of a particular value for your filter formula. I used a gallery, in my case, to provide all the possible dates that matches the given criteria.

     

    The result of the above filter formula will always be a table and cannot be used within the default property of the 'textinput'. 

  • NP-18101421-0 Profile Picture
    227 on at
    Re: IF Statement not working

    I am trying to pull the value into a Text Input field within a gallery. 

     

    Tried lookup:

    NPatel12498_0-1698085971105.png

     

  • vivekravi Profile Picture
    241 on at
    Re: IF Statement not working

    Hi @NPatel12498 ,

     

    Maybe can you try using lookup function? Also can you provide more details like are you using a gallery or a text box?

  • NP-18101421-0 Profile Picture
    227 on at
    Re: IF Statement not working

    Getting "Expected text value" error now

     

    NPatel12498_0-1698079870244.png

     

  • realwillwright Profile Picture
    772 Super User 2025 Season 1 on at
    Re: IF Statement not working

    Hi Can you try Value rather than Text

  • NP-18101421-0 Profile Picture
    227 on at
    Re: IF Statement not working

    After trying that, this is what I get:

     

    NPatel12498_0-1698078645334.png

    The datasource is SharePoint. 'Event Information' uses the regular ID and 'Checklist Details' uses Title which has a number but has data type as single line text. 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,962 Most Valuable Professional

Leaderboard