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 / Navigate to screen A i...
Power Apps
Answered

Navigate to screen A if Sharepoint List has attachments, otherwise Navigate to screen B

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a power app with a list on Sharepoint. I am visualizing my list via a Gallery.

 

I want to put the select button of the Gallery to Navigate to different screens depending on whether I have an attachement or not in my list.

My formula for now at OnSelect is:  If(MyList.'Has attachments' = true, Navigate('ScreenA'), Navigate('ScreenB')

 

But it does not work. The error is: Invalid argument type. 

 

Any suggestions?

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello,

     

    Take care with your Navigate formula.

    You have to set in your formula the second parameter which is the transition (None, Cover, UnCover, CoverRight, UnCoverRight and Fade).

     

    Don't forget to put a Select(Parent) before in your OnSelect Statement to select your item if you want to.

     

    Does it work for you ? 🙂

     

    Best regards,

     

    Louis

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I still does not work. I did add the Fade. Please note that I did not capture in the picture the second Navigate, but its the same as the first one. 

    The equal sign (=) has a little red underscore. No idea why. 

    screenshot5.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I didn't notice in your formula the error you did.

    On your OnSelect button, you dont have to compare the 'HasAttachments' variable of your SOURCE, but of your ITEM

    So, in your formula you have to write this :

    Select(Parent);If(ThisItem.'{HasAttachments}' = true, Navigate('Screen1', Fade), Navigate('Screen2', Fade)

    '{HasAttachments}' is my syntax, maybe you have to keep yours.

     

    Best regards,

     

    Louis

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Still does not work:

    screenshot6.png

    The error is: 'Invalid argument type'

     

    Update: If I do what you said, I get the error "Invalid number of arguments: received 1, expected 2 or more."

    screenshot7.png

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous, look on your image :

    You closed your If function just after your condition

     

    So, you would have 

    Select(Parent);
    If(ThisItem.'{HasAttachments}' = false,
    Navigate('Screen1', ScreenTransition.Fade),
    Navigate('Screen2', ScreenTransition.Fade)
    )

    Copy and paste this formula (changing screen's names)

     

    Best regards,

     

    Louis

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you! It works great! Have a great day man!

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard