Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / ThisRecord.Value makes...
Building Power Apps
Unanswered

ThisRecord.Value makes an error inside a IF sentence

Posted on by 462
Hi,
 
I have these set of data:
 
 
And for create the collection colUsers, I wrote:
 
ClearCollect(colUsers , AddColumns(colUniqueRequests, Country, Office365Users.UserProfileV2(ThisRecord.Value).country) , Name, Office365Users.UserProfileV2(ThisRecord.Value).displayName));
 
But, if I need to check is the user has another country setup in the tabla Holiday_Employees, I did:
 
ClearCollect(colUsers , AddColumns(colUniqueRequests, Country, If(!IsBlank(LookUp(Holiday_Employees, Email=ThisRecord.Value).Country.Name), LookUp(Holiday_Employees, Email=ThisRecord.Value).Country.Name, Office365Users.UserProfileV2(ThisRecord.Value).country) , Name, Office365Users.UserProfileV2(ThisRecord.Value).displayName));
 
And here, ThisRecord.value makes an error:
 
 
 
How can I fix it? Thanks for any help.
 
  • Suggested answer
    timl Profile Picture
    timl 31,447 on at
    ThisRecord.Value makes an error inside a IF sentence
    Hi EmilioRoqueta69
     
    ThisRecord shouldn't be necessary here because it'll reference the Holiday_Employees table rather than the colUniqueRequests collection.
     
    This should hopefully work better for you.
     
    ClearCollect(
        colUsers,
        AddColumns(
            colUniqueRequests,
            Country,
            If(
                !IsBlank(LookUp(Holiday_Employees, Email = Value).Country.Name),
                LookUp(Holiday_Employees, Email = Value).Country.Name,
                Office365Users.UserProfileV2(Value).country
            ),
            Name,
            Office365Users.UserProfileV2(Value).displayName
        )
    );
    
     
  • Try&Try Profile Picture
    Try&Try 8 on at
    ThisRecord.Value makes an error inside a IF sentence
    Have you tried ThisRecord.Email
    or ThisRecord.Email. and See what available options you have?

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,719

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard