Hi All,
I have a collectionA which is having Name and ID columns. I'm populating a combobox with Names by using(collectionA) and it was enabled for selecting multiple items.
Here i have to collect the data forall the Names with corresponding ID.
ClearCollect(MyCalendarNames,combobox.SelectedItems.DisplayName);
ForAll(collectionA.Name,
ClearCollect(collectionX ,Filter(Office365Outlook.GetEventsCalendarViewV2(
LookUp(collectionY,DisplayName in MyCalendarNames.Name).ID,
Text(DateAdd(dpkFrom.SelectedDate,-1,Hours),UTC),
Text(DateAdd(dpkTo.SelectedDate,1,Days),UTC)).value));
Can someone help me on this.
I did a POC on your requirement.
On App start, I created a collection as below:
ClearCollect(colIDNames,Table({ID:1,DisplayName:"A"},{ID:2,DisplayName:"B"},{ID:3,DisplayName:"C"},{ID:4,DisplayName:"D"},{ID:5,DisplayName:"E"}))
Placed a combo box on the screen and its Items property set to colIDNames.DisplayName.
On change property of the combo box, I placed following formula to get all the names and IDs:
ClearCollect(colNames, Filter(colIDNames,DisplayName in cbNames.SelectedItems))
With above formula, you will get only the selected items.
Please check and let me know if you can use it to resolve your issue.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi @rsaikrishna ,
Thanks for helping me.
The solution which you have shared works fine. I need help on the below code.
ForAll(collectionA.Name,
ClearCollect(collectionX ,Filter(Office365Outlook.GetEventsCalendarViewV2(
LookUp(collectionY,DisplayName in MyCalendarNames.Name).ID,
Text(DateAdd(dpkFrom.SelectedDate,-1,Hours),UTC),
Text(DateAdd(dpkTo.SelectedDate,1,Days),UTC)).value));
which was returning single record eventhough if we morethan 1 Name in collectionA.Name.
In your ForAll, you are using ClearCollect which is clearing the collection for every item in collectionA.Name loop.
You may need to use Collect in the place of ClearCollect.
Give a try and let me know if this helps.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi @rsaikrishna ,
I have tried by removing Clear but no luck.
We have multiple names with corresponding ID.
collectionA:
Name | ID |
ABC | 001 |
XYZ | 002 |
collectionB:
Name | ID |
ABC | 001 |
XYZ | 002 |
ForAll(collectionA.Name,
Collect(collectionX ,Filter(Office365Outlook.GetEventsCalendarViewV2(
LookUp(collectionY,Name in collectionB.Name).ID, // Here im using LookUp and returns same ID eachtime.
Text(DateAdd(dpkFrom.SelectedDate,-1,Hours),UTC),
Text(DateAdd(dpkTo.SelectedDate,1,Days),UTC)).value));
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 |
---|---|
203 | |
183 | |
76 | |
46 | |
37 |
User | Count |
---|---|
328 | |
260 | |
123 | |
72 | |
58 |