web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching a LookUp Comb...
Power Apps
Answered

Patching a LookUp ComboBox from Collection

(0) ShareShare
ReportReport
Posted on by 356

Patching from a collection with no problem except that ComboBox :{

 

My Collection:

ClearCollect(
ColAddContact,
{
ColOtherID: InputOtherID.Text,
ColStudentLastName: InputStudentLastName.Text,
ColStudentFirstName: InputStudentFirstName.Text,
ColContactDate: ContactDatePicker.SelectedDate,
ColContactType: InputContactType.Text,
ColContactName: InputContactName.Text,
ColContactMade: tgContactMade.Value,
ColNotes: InputNotes.Text};

);

 

ColContactType: is coming from a Lookup ComboBox called ddContactType

 

My current patch statement:

ForAll(ColAddContact,
Patch('AT HOME LEARNING STUDENT CONTACT LOG',
Defaults('AT HOME LEARNING STUDENT CONTACT LOG'),
{LogOtherID: ColOtherID},
{LogStudentLastName: ColStudentLastName},
{LogStudentFirstName: ColStudentFirstName},
{LogContactDate: ColContactDate},

LogContactType- No idea how to get this into the patch list

{LogContactPerson: ColContactName},
{LogNotes: ColNotes},
{LogContactMade: ColContactMade}
)

 

How can I capture this lookup data from the ddContactType and patch it into the list.  I have tried everything as you can tell by that clumsy way I tried populate an input text box and Collect from it.

 

Flustered!

 

Categories:
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @slhangen ,

    Do you want to patch a collection to your sharepoint list?

    Could you tell me:
    1)ddContactType combo box's Items?

    2)what is InputContactType? 

    3)you said "ColContactType: is coming from a Lookup ComboBox called ddContactType", why you use "InputContactType.Text" to update ColContactType field in your collection?

    4)the data type of LogContactType in your list?

    Firstly, the right syntax of ForAll function should be like this:

    ForAll(ColAddContact,
    Patch('AT HOME LEARNING STUDENT CONTACT LOG',
    Defaults('AT HOME LEARNING STUDENT CONTACT LOG'),
    {LogOtherID: ColOtherID,
    LogStudentLastName: ColStudentLastName,
    LogStudentFirstName: ColStudentFirstName,
    LogContactDate: ColContactDate,
    LogContactType:....
    LogContactPerson: ColContactName,
    LogNotes: ColNotes,
    LogContactMade: ColContactMade}
    )
    )

     

    Secondly, about LogContactType field.

    1)If combo box's Items is: Choices(list1.field1)

    field1 is a lookup field

    Then you should update your collection like this:

    My Collection:
    
    ClearCollect(
    ColAddContact,
    {
    ColOtherID: InputOtherID.Text,
    ColStudentLastName: InputStudentLastName.Text,
    ColStudentFirstName: InputStudentFirstName.Text,
    ColContactDate: ContactDatePicker.SelectedDate,
    ColContactType: ddContactType.Selected,
    ColContactName: InputContactName.Text,
    ColContactMade: tgContactMade.Value,
    ColNotes: InputNotes.Text};
    
    );

    If LogContactType is lookup type, looked up to field1 in list1, the patch function:

    ForAll(ColAddContact,
    Patch('AT HOME LEARNING STUDENT CONTACT LOG',
    Defaults('AT HOME LEARNING STUDENT CONTACT LOG'),
    {LogOtherID: ColOtherID,
    LogStudentLastName: ColStudentLastName,
    LogStudentFirstName: ColStudentFirstName,
    LogContactDate: ColContactDate,
    LogContactType:ColContactType
    LogContactPerson: ColContactName,
    LogNotes: ColNotes,
    LogContactMade: ColContactMade}
    )
    )

     

    2)If combo box's Items is: Choices(list1.field1)

    field1 is a lookup field

    If LogContactType is text type, looked up to field1 in list1, the patch function:

    ForAll(ColAddContact,
    Patch('AT HOME LEARNING STUDENT CONTACT LOG',
    Defaults('AT HOME LEARNING STUDENT CONTACT LOG'),
    {LogOtherID: ColOtherID,
    LogStudentLastName: ColStudentLastName,
    LogStudentFirstName: ColStudentFirstName,
    LogContactDate: ColContactDate,
    LogContactType:ColContactType.Value
    LogContactPerson: ColContactName,
    LogNotes: ColNotes,
    LogContactMade: ColContactMade}
    )
    )

     

     

    Anyway, you need to use different formulas based on your settings of combo box and data type.

     

     

    Best regards,

  • slhangen Profile Picture
    356 on at

    See attached for screen shots.  Not an elegant solution but this is my first app.

    Capture1.JPG
    Capture3.JPG
    Capture2.JPG
  • slhangen Profile Picture
    356 on at

    Could you tell me:
    1)ddContactType combo box's Items? see attached, coming from SP list column that is a  lookup from SP list named Contact Type

    2)what is InputContactType?  A bad attempt to collect the data from the combo box

    3)you said "ColContactType: is coming from a Lookup ComboBox called ddContactType", why you use "InputContactType.Text" to update ColContactType field in your collection? See above

    4)the data type of LogContactType in your list? Lookup from SP list named Contact Type

     

    Hope this clears it up a little.

    cbContactType.JPG
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @slhangen ,

    Do you mean these:

    1)ddContactType drop down display:   a lookup column in Contact Type list?

    ddContactType's Items:   (please tell me the lookup column name in Contact Type list?)

    Choices('Contact Type'.fieldname)
    //the lookup field name

    2)InputContactType  --I still not understand why you use this. You could directly use the selectedvalue of  ddContactType to update.

    3)LogContactType is a lookup field(lookup to Contact Type list)

    please tell me LogContactType looks up to which field in Contact Type list?

     

     

    Best regards,

  • slhangen Profile Picture
    356 on at

    After tweaking this, it worked.  Thanks so much for all your assistance.  I love the support on this forum!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard