Solved

How to access the collection data from a people control on a form?

  • 16 December 2022
  • 6 replies
  • 193 views

Userlevel 1
Badge +5

Hi All,

I’m trying to access data from a people form control using a get item from collection action within a loop for each action but as you can see below, the object’s data is greyed out.  Is there another way to access the people control data?

 

icon

Best answer by bsikes 16 December 2022, 16:08

View original

6 replies

Userlevel 4
Badge +10

I may misunderstanding how the system works, but I believe the collection returned by the people form control is a collection of people objects. Each people object has attributes like First Name, Email, Id, etc. BUT, this is an object not a collection, so using the Get Item From Collection action won’t be applicable.

In this case, I think you could just reference the attribute you need from the current Loop For Each object. Or, if you need to have the attributes as workflow variables, you could just use the Set a Variable Value action from inside your loop. 

Userlevel 1
Badge +5

Thanks so much @bsikes that makes complete sense!

I was over complicating it by trying to get the data into variables 🤦‍♀️🤣.  I needed the email address so I just moved the send an email action into the loop for each action 😀

Userlevel 3
Badge +8

Hi @TaniaS ,

 

Just beware that moving the email step within the loop may result in sending an email for each item you are iterating through. If that is not supposed to happen, then getting the email/s from the collection and setting it in a variable is the correct way to go about it

Userlevel 1
Badge +5

@Prineel_V3 Can you suggest a way of accessing the email and setting it as a variable?  I haven’t been able to figure out how to do it.

Userlevel 4
Badge +10

Inside your Loop For Each, you can use the Set a Variable Value action to set a workflow variable equal to the email value in the current iteration of your loop. 

 

Action Placement
Set a variable value definition

 

Userlevel 1
Badge +5

@bsikes thank you so much, I really appreciate the help 😀

Reply