Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Answered

icon should be visible when the user email is listed

(1) ShareShare
ReportReport
Posted on by 578 Super User 2025 Season 1
I am just trying to find out whats my mistake in my formula 

I have a gallery where there is an icon that is supposed to be visible if the current user is listed in that specific column named isDownloadedBy

my varCurrent user definition: 
Set(varCurrentUser, User().Email);

here is the button that downloads the file which patches the user's email to the column. I have checked the list and what email was patched and it is all in lowercase.
 
ForAll(
    Filter(galDownloadNDAFiles.AllItems, cbSelectFile_ADFS.Value = true), 

    //for each selected record, download the file
    Download(
        "https://xyz.sharepoint.com/sites/xyz/_layouts/15/download.aspx?" & "SourceUrl=https://xyz.sharepoint.com/sites/xyz/" & ThisRecord.'Full Path'
    ); 


    //put the email of the user who downloads the file
    Patch(
        'Uploads', 
        ThisRecord,
        {
            isDownloadedBy: 
                If(
                    IsBlank(ThisRecord.isDownloadedBy), 
                    varCurrentUser,
                    ThisRecord.isDownloadedBy & ", "& varCurrentUser
                )
        }
    );
)



heres my visible property formula for the icon inside the gallery. 
 
With(
    {
        splitAdmins: Split(ThisItem.isDownloadedBy, ",")
    }, 
    varCurrentUser in ForAll(splitAdmins, Lower(Trim(Value)))
)

doesn't seem to work even though my email is listed in the column.
  • KevinGador Profile Picture
    578 Super User 2025 Season 1 on at
    icon should be visible when the user email is listed
    @stampcoin ahh yess! This is the case! I can now see the check. I ddn't realize that it needs refreshing.

  • Verified answer
    stampcoin Profile Picture
    2,293 on at
    icon should be visible when the user email is listed
    I think your with (......) won't reflect the updated record immediately after the patch. At least I didn't see it from your description.
    After For All, add :
    Refresh('Uploads')  // assume this is your gallery data source, otherwise change it to your gallery data source.
    Then you will get the patched result.
     
     
     
  • BCBuizer Profile Picture
    22,165 Super User 2025 Season 1 on at
    icon should be visible when the user email is listed
    Hi!
     
    Still it's hard to give feedback without seeing sample values.
     
    What is clear from the additional formula is the delimeter that is used. Based on this, the formula for the visible propert of the icon can be simplified to:
     
    Lower(varCurrentUser) in Split(
        ThisItem.isDownloadedBy, 
        ", "
    )
     
     
    If this reply helped you in any way, please give it a Like 💜 and in case it resolved your issue, please mark it as the Verified Answer ✅.
  • KevinGador Profile Picture
    578 Super User 2025 Season 1 on at
    icon should be visible when the user email is listed
    Apologies for posting a question with incomplete codes.

    I have updated the post with the download button functionality which puts the user's email in the isDownloadedBy column.
  • Suggested answer
    stampcoin Profile Picture
    2,293 on at
    icon should be visible when the user email is listed
     
    This totally depends on your 'isDownloadedBy' value,
    If it has values like full name, it will absolutely not work.
    and the code you have , it's better to use :
    With(
        {
            splitAdmins: Split(Gallery1.Selected.Value ,",")
        }, 
        !IsEmpty(
            Filter(
                splitAdmins,
                Lower(Trim(Value)) = Lower(Trim(varCurrentUser))
            )
        )
    )
    Also, you have to consider the empty value.
    So, please check what is the value in isDownloadedBy, if it contains full name, the varCurrentUser should have User().Fullname
     
     
  • BCBuizer Profile Picture
    22,165 Super User 2025 Season 1 on at
    icon should be visible when the user email is listed
    Hi!
     
    Can you please share an example values for both the var and isDownloadedBy? Without that it's a guessing game.
     
    Perhaps the issue is that there are calitals in the variable value. This can be fixed by using the Lower fuction:
     
    Set(varCurrentUser, Lower(User().Email));
     
    If this reply helped you in any way, please give it a Like 💜 and in case it resolved your issue, please mark it as the Verified Answer ✅.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics