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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Clicking on a button inside a gallery will referecne the row below on published app

(0) ShareShare
ReportReport
Posted on by 1,774 Super User 2024 Season 1
I have 2 Sharepoint lists:-
 
1) SpareParts
2) SparePartIndividual which store the SparePart ID for parent item inside a column named "Spare Part ID".
 
The gallery has a button named "Fixed" with this code:-
 
 
 
Set(varSPApprovalStatus,"Disabled");
 
If(
    LookUp(
        'Spare Part Individuals',
        ID = ThisItem.ID
    ).Modified = ThisItem.Modified,
    Notify(
        ThisItem.'Spare Part ID',
        NotificationType.Information,100000
    );
    Patch(
        'Spare Part Individuals',
        LookUp(
        'Spare Part Individuals',
        ID = ThisItem.ID
    ),
        {'Spare Part Status': {Value: "In Stock"}}
    );
    'UpdateIntegrationForSparePart(Elevated)'.Run(ThisItem.'Spare Part ID',"SPI+1");
   
    Patch(
        'Spare Parts',
       
            LookUp(
            'Spare Parts',
            ID = ThisItem.'Spare Part ID'
        ),
          {  Quantity: LookUp(
            'Spare Parts',
            ID = ThisItem.'Spare Part ID'
        ).Quantity + 1
        }
    );
    Notify(
        "Record was set as Fixed",
        NotificationType.Success
    )
 
,
    Notify(
        "Record was already assinged",
        NotificationType.Error
    )
);
Refresh('Spare Part Individuals');
Set(varSPApprovalStatus,"Edit");
 
and the gallery has this items property:-
 
Sort(Filter('Spare Part Individuals',
'Spare Part Status'.Value = "Hold" And
('Serial Number' = varSerialNoSRCH ||IsBlank(varSerialNoSRCH) )And
('Barcode Value' = varBarcodeSRCH || IsBlank(varBarcodeSRCH) )
And
('Barcode Value' = varScannedBarcodeSRCH ||IsBlank(varScannedBarcodeSRCH))),Modified,SortOrder.Descending)
 
now this is working well when i am on design mode, but on the published app, the quantity for the spare part will reference the row below... so what is causing this?
 
So if i click on "Fixed" button, for the second row, then the spartpart with title = "test" will have its Quantity increased by 1 instead of the spartpart with title = "Test GP"... i have been trying to fix this for the whole day without any luck.. any advice?
 
Thanks
I have the same question (0)

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 706 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 330 Super User 2025 Season 2

#3
SebS Profile Picture

SebS 226 Moderator

Last 30 days Overall leaderboard