Hi, I'm new in powerapps
can somebody help me
I try to make a collection with using lookup another collection to make value if it finds specific id
But the result is not what I expected. It result all the row in column "return" is same,
Even if I check it one by one, it should be different
If I check from other collection
it should be:
returnable
returnable
returnable
Non Returnable
Non Returnable
Non Returnable
Non Returnable
is my script wrong when using lookup from different collection?
Solved! Go to Solution.
Your trouble comes from the item_code=item_code. This will always return a true and thus you will get the first record in item_col all the time.
Consider the following formula to replace yours:
Clear(nd6_stockReport);
With({_user: LookUp(user, email=User().Email},
ForAll(
nd6_standart as _nd6,
Patch(nd6_stockReport,
Defaults(nd6_stockReport),
{
month:Text(_nd6.month_stockcount),
region: _user.region,
ship_to: _user.code,
distributor: _user.name,
return: _user.return,
item_code: LookUp(item_col, item_code = _nd6.item_code, return),
item_name: _nd6.item_name,
main_stokSistem: Value(_nd6.mainstokSistem)
}
)
)
);
Navigate(distributor_home)
I hope this is helpful for you.
Your trouble comes from the item_code=item_code. This will always return a true and thus you will get the first record in item_col all the time.
Consider the following formula to replace yours:
Clear(nd6_stockReport);
With({_user: LookUp(user, email=User().Email},
ForAll(
nd6_standart as _nd6,
Patch(nd6_stockReport,
Defaults(nd6_stockReport),
{
month:Text(_nd6.month_stockcount),
region: _user.region,
ship_to: _user.code,
distributor: _user.name,
return: _user.return,
item_code: LookUp(item_col, item_code = _nd6.item_code, return),
item_name: _nd6.item_name,
main_stokSistem: Value(_nd6.mainstokSistem)
}
)
)
);
Navigate(distributor_home)
I hope this is helpful for you.
huwaaa, Thank you so much @RandyHayes
it works! although you misplace some codes, but I understand the concept and make it works
Thanks, I also learn how to use "with", and "as" in this powerapps
I don't know about it before 🙂
Yes, I see at least two typos now in the formula. I do type these all by hand, so I don't get the luxury of the Formula Editor to help 😉
I am glad that this worked for you and that you learned a couple of things.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
212 | |
194 | |
82 | |
59 | |
38 |
User | Count |
---|---|
305 | |
255 | |
120 | |
86 | |
55 |