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.
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 |
---|---|
189 | |
53 | |
51 | |
34 | |
33 |
User | Count |
---|---|
268 | |
91 | |
80 | |
68 | |
67 |