Ok, I might be going insane here, but this Lookup() function is not functioning correctly. Its so complicated though, I don't know if it can be explained in a forum post, but here goes.
Schema of Collection colThings (an API Response):
{ "level1": [ { "level2_location": { "city": "SEATTLE ", "state": "WA" }, "level2_thing": [ { "level3_thingNumber": "11223344", "level3_thingList": [ { "level4_thingID": { "thingInit": "ABC ", "thingNum": " 778899" }, "level4_thingStatus": { "statusIndicator": "Y" } } ] } ] } ] }
Gallery Items Property:
(Adding a column to measure the number of things with StatusIndicator "Y". Used elsewhere in the app)
AddColumns( First( First( colThings.level2_thing ).level2_thing.level3_thingList ).level3_thingList, "statusSum", If( level4_thingStatus.statusIndicator = "Y", 1,0 ) )
OnChange of a Toggle Control in each Gallery item:
(Big thanks to Kris Dai for assisting with the Remove() function here!)
If( ThisItem.level4_thingStatus.statusIndicator <> If( toggle.Value = false,"Y", toggle.Value = true,"N" ), Collect(colPOSTstatuses, Table( { level3_thingList: Table( { level4_thingID: { thingInit: ThisItem.level4_thingID.thingInit, thingNum: ThisItem.level4_thingID.thingNum, thngPrefix: ThisItem.level4_thingID.thngPrefix }, level4_thingStatus:{ statusIndicator: If( toggle.Value = false,"Y", toggle.Value = true,"N" ) } } ) } ) ), Remove(colPOSTstatuses, LookUp(colPOSTstatuses, First(level3_thingList.level4_thingID).level4_thingID.thingNum= ThisItem.level4_thingID.thingNum ) ) )
The Lookup() function that is not working:
If( IsBlank( LookUp( colPOSTstatuses.level3_thingList, level3_thingList.thingNum = ThisItem.level3_thingList.thingNum, level4_thingStatus.statusIndicator ) ), "Blank", LookUp( colPOSTstatuses.level3_thingList, level3_thingList.thingNum = ThisItem.level3_thingList.thingNum, level4_thingStatus.statusIndicator ) )
Test:
The issue?:
Solved! Go to Solution.
Thanks @KickingApps !!
The problem:
Was:
If( IsBlank( LookUp( colPOSTstatuses.level3_thingList, level3_thingList.thingNum = ThisItem.level3_thingList.thingNum, level4_thingStatus.statusIndicator ) ), "Blank", LookUp( colPOSTstatuses.level3_thingList, level3_thingList.thingNum = ThisItem.level3_thingList.thingNum, level4_thingStatus.statusIndicator ) )
Changed to:
LookUp( colPOSTstatuses.level3_thingList, First(First(colPOSTstatuses.level3_thingList).level3_thingList.level4_thingID).level4_thingID.thingNum = ThisItem.level4_thingID.thingNum, First(First(colPOSTstatuses.level3_thingList).level3_thingList.level4_thingStatus).level4_thingStatus.statusIndicator )
ok @ericonline ... lets try this again 🙂 :
This worked to bring results back for every Gallery item, not just the first value in the Collection:
LookUp( colPOSTstatuses, First(level3_thingList.level4_thingID).level4_thingID.thingNum= ThisItem.level4_thingID.thingNum, First(level3_thingList.level4_thingStatus).level4_thingStatus.statusIndicator )
Thanks @KickingApps !!
The problem:
Was:
If( IsBlank( LookUp( colPOSTstatuses.level3_thingList, level3_thingList.thingNum = ThisItem.level3_thingList.thingNum, level4_thingStatus.statusIndicator ) ), "Blank", LookUp( colPOSTstatuses.level3_thingList, level3_thingList.thingNum = ThisItem.level3_thingList.thingNum, level4_thingStatus.statusIndicator ) )
Changed to:
LookUp( colPOSTstatuses.level3_thingList, First(First(colPOSTstatuses.level3_thingList).level3_thingList.level4_thingID).level4_thingID.thingNum = ThisItem.level4_thingID.thingNum, First(First(colPOSTstatuses.level3_thingList).level3_thingList.level4_thingStatus).level4_thingStatus.statusIndicator )
eh! This only returns the First value in colPOSTstatuses! Need a way to return the value for each item in the Gallery.
ok @ericonline ... lets try this again 🙂 :
This worked to bring results back for every Gallery item, not just the first value in the Collection:
LookUp( colPOSTstatuses, First(level3_thingList.level4_thingID).level4_thingID.thingNum= ThisItem.level4_thingID.thingNum, First(level3_thingList.level4_thingStatus).level4_thingStatus.statusIndicator )
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
185 | |
53 | |
41 | |
36 | |
30 |
User | Count |
---|---|
241 | |
74 | |
71 | |
69 | |
65 |