web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If statement Record co...
Power Apps
Answered

If statement Record comparison

(0) ShareShare
ReportReport
Posted on by 9

Good morning all

please lend me a hand with this, ive tried all and some, I need to compare a record to record value and am pulling my hair out...

 

Set(varTT,Gallery1.Selected.Status);
Set(varTTT,{Status:{Value:"Production"}});

 

If( varTT = varTTT, true, false)

 

Thanks

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @Evolve809 ,

     

    Please try:

    varTT.Value = varTTT.Status.Value

    if statement is not needed here.

     

    Best regards,

  • Evolve809 Profile Picture
    9 on at

    Thanks for the quick response!

     

    Let me give you the followup in the if statement...

     

    Set(varTT,Gallery1.Selected.Status);
    Set(varTTT,{Status:{Value:"Production"}});

     

    If( varTT = varTTT ,Patch('Job Card Clients',GalleryClients.Selected,{'Total Time':Text(varTot)}),Patch('Job Card Exchange Units',GalleryEX.Selected,{'Total Time':Text(varTot)}));

     

    As you can see I need to patch two different lists depending on the validity of the if statement outcome.

     

    Does your suggested solution have outcome options?

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Evolve809 ,

     

    The expression varTT.Value = varTTT.Status.Value returns true or false just like in a If statement.

     

    Actually, the two variables are not needed either:

    If(Gallery1.Selected.Status.Value = "Production" ,Patch('Job Card Clients',GalleryClients.Selected,{'Total Time':Text(varTot)}),Patch('Job Card Exchange Units',GalleryEX.Selected,{'Total Time':Text(varTot)}));

     

    Best regards,

  • Evolve809 Profile Picture
    9 on at

    Thanks!! Ya the variables was part of a vailed attempt in all honesty.

    It's thank goodness not erroring but for some reason its not patching to a one of the lists? You maybe have a smart plan to correct that?

  • v-jefferni Profile Picture
    on at

    Hi @Evolve809 ,

     

    I suspect it's due to the limitation of If function. Is it possible that using 2 buttons, each for patching to one data source? You can control the visibility of the two buttons on the condition above:

     

    to clients button:

    Patch('Job Card Clients',GalleryClients.Selected,{'Total Time':Text(varTot)})

    Visible:

    Gallery1.Selected.Status.Value = "Production"

     

    to exchange units button:

    Patch('Job Card Exchange Units',GalleryEX.Selected,{'Total Time':Text(varTot)})

    Visible:

    !(Gallery1.Selected.Status.Value = "Production")

     

    Best regards,

  • Evolve809 Profile Picture
    9 on at

    Thanks as a last resort I can build that solution in.

    alternatively, is it possible to patch to the initial combined gallery?

    The split galleries are just incorporated on a screen that cant be seen at all in an attempt to do the if statement thing.
    If I can patch to the combined data that'll be first first prize!!
    Thanks sooo much for your help.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard