cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Prepopulating a data card with people's emails

Hi there,

 

In my PowerApp, I create a new meeting item every week by filling in information on a form. One of the datacards on this form is 'Meeting_Attendees'. With this datacard, I can search people's emails and select the necessary ones i.e. I would search for the emails of the people who attended the meeting for that specific week and add them. However, I want to be able to prepopulate this datacard with a number of emails for efficiency as most of the people turn up to these meetings every week bar a few, to which I could just remove their emails from the selection. Is there a way in which I could go about doing this?

 

5 REPLIES 5
DamoBird365
Microsoft
Microsoft

Hi @Anonymous 

 

I've assumed that your data source is something like a list with multi select on person field.

 

You can create a collection of emails/names as follows:

 

DamoBird365_0-1647463622000.png

 

And then set the default for your datacard to said collection:

 

DamoBird365_1-1647463692604.png

 

 

Sample Collection:

ClearCollect(colPeople,
{Claims:"i:0#.f|membership|damien@yourtenant.onmicrosoft.com",
Email:"damien@yourtenant.onmicrosoft.com",
DisplayName:"Damien"},
{Claims:"i:0#.f|membership|daveazure@yourtenant.onmicrosoft.com",
Email:"daveazure@yourtenant.onmicrosoft.com",
DisplayName:"Dave"})

 

Hope i've got you right 👍

 

Damien

Anonymous
Not applicable

Thanks Damien, 

 

For some reason that isn't working for me. I put the collection code into the Items property of my dropdown and the collection name into the default property, however they both return an error. I tried another way whereby I put the collection code into the OnSelect property of a button and then the collection name into the Items property of the dropdown and this seems to work fine, however it does not pre-populate the emails into the dropdown - it just shows me all the emails in the collection and allows me to select whichever ones I need. While this is not a bad alternative, it still does not pre-populate the dropdown with all the emails which is ultimately what I want. 

 

Do you have any more potential suggestions.

Thanks.

 

Hi @Anonymous 

 

You want to create the collection, either via a button control or onstart, so that colPeople contains the people you want by default, then on your form datacard, set the default to the collection.  I think you have set the items to the collection, which would then limit the available contacts to those in the collection, rather than the original data source.  You want to set the default selected people, in which case you should set the default to the collection.  

 

If you have any errors once you have tried this, please share a screenshot or two.  Thanks

 

Damien

Anonymous
Not applicable

Thanks Damien, this does work alright. I was wondering is there possibly a way to prepopulate the datacard with peoples names from a distribution list rather than manually typing all the relative people's names into a collection? This would be more efficient for what I am trying to achieve.

Hi @Anonymous 

 

You could use the Office365Groups Connector.  Something like :

Office365Groups.ListGroupMembers("fc87fea4-4f64-4851-b583-db14dbab99b8")

 

Perform a ClearCollect on this expression and then everything from previous will still apply.

 

Damien

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,430)