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 / 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:
  • v-jefferni Profile Picture
    Microsoft Employee 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
    Microsoft Employee 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
    Microsoft Employee 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

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard