cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daryl_K
Helper II
Helper II

A combo box that searches one SharePoint list but writes to another

I am about as "noob" to PA as can be, but I have seen some apps that do exactly what I am looking for.

 

Essentially it searches a column in one SharePoint list, and when you find the desired value it will write it to a column in a different list. The functionality is similar to how you'd populate one column (using InfoPath) from a data connection to another.

 

I have an app created and both lists as data sources, but just started playing with PA so am learning the terminology. Even a link to a beginners video (that explains what I am trying to do) would be great.

 

 

 

7 REPLIES 7
CNT
Super User
Super User

@Daryl_K A couple from some top PA YouTubers

https://www.youtube.com/watch?v=g9ChYuTdNd4

https://www.youtube.com/watch?v=wDKuLeK9N9Q

https://www.youtube.com/watch?v=gX5q_V3U8-s

You'll find tons more.

If you explain u'r App a bit more maybe we can try and fix it. Hope this helps!

v-albai-msft
Community Support
Community Support

Hi @Daryl_K ,

Do you want to get a value based on selection in a combo box, and then update this value into another list(or create a new list item)?

If yes, based on your information, I did a test on my side for your reference:=

1. I have two lists called “list9” and “list10”. In list9, there is a Choice column called “Status”, In list10, there is a Text column called “test1”. Shown as below.

v-albai-msft_0-1621479254585.png

 

 

v-albai-msft_1-1621479254587.png

 

2. So based on above two screenshots, when selecting “resolved” in the combo box, I want to get the mode value(“bbb”) of this list item, and update this mode value into list10 list, to the list item who has same Title value.

So I can use this formula:

Patch(list10,LookUp(list10,Title=TextInput1.Text),{test1:LookUp(list9,Status.Value=ComboBox1.Selected.Value).mode})

v-albai-msft_2-1621479254592.png

Notes:

1. TextInput1 is the name of my TextInput control, ComboBox1 is the name of my combo box control.

2. LookUp(list10,Title=TextInput1.Text) means which list item in list10 you want to update.

3. LookUp(list9,Status.Value=ComboBox1.Selected.Value).mode  can get the mode value based on selection in combo box from list9.

 

Besides, if you want to create a new list item in list10 instead of updating a existing one, you can try this formula(Title is a required column, you must give it a value when creating a new list item):

Patch(list10,Defaults(list10),{Title:XXX, test1:LookUp(list9,Status.Value=ComboBox1.Selected.Value).mode})

I would also recommend you refer to the "Overview and Examples" sections mentioned in this article about Patch function.

Best regards,

Allen

Hello and thank you for the response.

 

This is actually quite close to what need, though my requirements are a tiny bit more simple. In my case a form drop-down would list he contents of the list9 Status column, showing one instance of each entry (it may have repeats). When I select, say, "resolved" it would then write "resolved" into the list10 test1 column.

 

I could think of some cases where the offset function you demonstrate here could be useful too, so I thank you for that.

 

Oh, I should add that when creating a new entry it should be blank (the destination), but after writing that value it is displayed there instead.

Hi @Daryl_K ,

What do you mean about "when creating a new entry it should be blank (the destination), but after writing that value it is displayed there instead"? Do you mean you have issue when create a new item in list10 using Patch function? Or do you mean you just want to create a new item in SharePoint side, and update this item in PowerApps side?

Best regards,

Allen 

I'll try to explain best I can. Let's say I have two lists: List A and List B. List A is a source, List B is the one my form is creating an entry in.

 

So I "create new" in my form, and the drop-down displays List A, column 1. I select some value from the drop-down, save and close the form. When I come back later and re-open the form it displays the selected value as it was written to List B, column 1.

 

I have seen a Power App doing exactly this, though how the went about it I may be confusing.

@Daryl_K What is in the Items property of your Form. Is it pointing to List B? Also, when you say "create new", save etc, how are you doing that. Any code snippets would be helpful.

Hi @Daryl_K ,

What do you mean about "come back later and re-open the form"? Is this a new question (compared to the first one you asked)?

How about your first issue(patch to another list), have you solved it?

Best regards,

Allen

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,860)