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 / How can I compare two ...
Power Apps
Unanswered

How can I compare two values ​​of two collect with their id?

(0) ShareShare
ReportReport
Posted on by 137

Hello community, I have a question.

 

I have a problem when comparing two different values ​​of an inventory, I show you the example.

 

I have these two collects, how can I compare all the collect of deliveries by the id to know that the quantity of output is less than that of the inventory. (Like in the product6 there should be a mistake)

How could it be solved by means of a forall with if or something that can solve the problem.

 

Regards.

JA

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Jesus_Aguirre,

    Based on the issue that you mentioned, do you want to know if the output is less than the inventory based on the ID?

    Could you please share a bit more about the scenario?

    I think a collection could achieve your needs.

    I have two tables just like yours stored in OneDrive.

    Add a button and create a collection like this:

     

    Collect(ColSum,AddColumns(AddColumns(AddColumns(Inventory,"quantity",LookUp(Deliveries,ID=Inventory[@ID],Quantity)),"Remaining",Quantity-quantity),"Is output less than inventory?",If(Remaining<0,"Yes","No")))

     

    Add a DataTable and set the Items property as below:

     

    ColSum

     

    kkk.png

    Note: The "Is output less than inventory?" column will clearly display if  the quantity of output is less than that of the inventory.

    If you want to pop out a error message when the quantity of output is less than that of the inventory, I think you should use a form.

    Add a Gallery and an Edit Form3.

    Set the Items property of Gallery as below:

    Deliveries

    Add a "+" icon and set OnSelect as below:

    NewForm(EditForm3);Navigate(Screen3)

    Set the DataSource of the form as below:

    Deliveries

    Set the Item property of the form as below:

    Gallery2.Selected

    Set the OnChange property of the TextInput corresponding to the Quantity as below:

    If(LookUp(Inventory,ID=ThisItem.ID,Quantity)-DataCardValue25.Text<0,Notify("The quantity of output is less than that of the inventory!",NotificationType.Error))

    Note: Once you type in a number that more than it is in the Inventory table, an error message will pop up.

    Check the GIF.

    GIF008.gif

    Hope it could help.

    Regards,

    Qi

  • Jesus_Aguirre Profile Picture
    137 on at

    Hi everyone.

     

    Exact can be used in that case for a form, or if you don't want to create a collect you can use what appears in the following link

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/How-can-I-compare-two-values-of-two-collect-with-their-id/m-p/820910#M261389

     

    Thanks and regards.

    JA

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard