I'm tying a PowerApp as a Canvas App to D365 (CRM). I have a table called "Deposits" and in there I have a field called "Deposit Amount", one called "Related ID", and another called "Deposit Type". Deposit type is a Choice field in Dataverse-speak, or an Option Set in CRM. One of those options is GST with the value 859270005. Related ID is a lookup (GUID), and Amount is a numeric field.
In the PowerApp, I want to update all records for a specific related ID, setting the Deposit Amount to 0 if the Deposit Type is "GST".
I'm trying to do this by first creating a collection, but none of the formats below work (I've removed the Related ID portion just to keep it as simple as possible):
ClearCollect(relatedDeposits,LookUp(Deposits,'Deposit Type'="GST"));
ClearCollect(relatedDeposits,LookUp(Deposits,'Deposit Type'='Deposit Type'.GST));
ClearCollect(relatedDeposits,LookUp(Deposits,'Deposit Type'=859270005));
None of these work. What format is intended/expected for PowerApps to filter like this? I've also tried a Filter statement in place of Lookup, same result.
There is a screenshot in the attachments if that helps. I've been banging my head against a wall for two hours on this and can't find the answer. I'm sure it's something simple, so feel free to berate me if you're also providing me the answer 😉
Thanks
Garrett
Hi @gwengreniuk ,
LookUp will produce a single record (the first one matching) - you need Filter for your Collection.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I think the formula would look something like this:
ClearCollect(relatedDeposits, Filter(Deposits,'Deposit Type' = 'Deposit Type (Deposits)'.GST))
Hi Warren,
As noted in the description, I tried Lookup and Filter (in case there was a difference in the syntax), neither works.
I believe the issue is in the filter itself, that's what I'm attempting to resolve.
Thanks
Garrett
Hi Jeff,
The autocomplete doesn't show 'Deposit Type (Deposits)' as an option, and the syntax you provided doesn't work either. I've seen that format where a relationship exists, but in this case it's filtering on the same table so I'm assuming that's why I don't see the (Deposits) portion.
Interestingly I notice the Autocomplete for the first 'Deposit Type' (left of the equals) actually shows the value twice... Maybe that gives an indication of why PowerApps doesn't seem to be recognizing the choice field properly?
Any other ideas?
Thanks,
Garrett
HI @gwengreniuk ,
Try this
ClearCollect(
relatedDeposits,
Filter(
Deposits,
'Deposit Type'=[@'Deposit Type'].GST
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @gwengreniuk ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
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 |
---|---|
205 | |
187 | |
70 | |
38 | |
34 |
User | Count |
---|---|
348 | |
268 | |
122 | |
78 | |
60 |