cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Auto populate Text box based on a Dropdown selected value in Sharepoint list column

Hi

 

I have a SP list called "WASTE CODE" which have 2 columns (refer to the attached files): .

 

1. Title - Single line of text

2. Category of Waste - - Single line of text .

SP List with 2 columnsSP List with 2 columns

I have created a custom PowerApps form for another SP list named "WASTE CARD FORMS" (refer to the attached files). . The Waste Code field in the custom form is being reset to Dropdown field pulling data from SP list "WASTE CODE" in the TItle column, and its working fine. .

 

I cant figure out how to auto populate the "CATEGORY OF WASTE" field in the custom form based on the corresponding Category of Waste value in the WASTE CODE list, when the WASTE CODE is selected from the Dropdown field in the custom form.

 

SPCustomForm.jpg

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @whasmadi ,

Do you want to auto-populate the "CATEGORY OF WASTE" field in your custom form based on the selected Waste Code value?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Waste Code Dropdown box to following:

Distinct('Waste Code', Title)

set the Update property of the Waste Code field data card to following:

WasteCodeDropdownbox.Selectd.Result

 

Set the Default property of the "CATEGORY OF WASTE" field in the custom form to following:

If(
   SharePointForm1.Mode = FormMode.New,
   LookUp('Waste Code', Title = WasteCodeDropdownBox.Selected.Result, 'Category Of Waste'),
   Parent.Default
)

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Super User III
Super User III

Hi @whasmadi ,

I am using names here based on your screenshots - I will call your fields WasteCodeTxt and CatWasteTxt - change to your control names. I have also called your Form EditForm1. In the Default of CatWasteTxt

 

If(
   EditForm1.Mode = FormMode.New,
   Lookup(
      'Waste Code',
      Title = WasteCodeTxt.Text,
      'Category Of Waste
   ),
   Parent.Default
)

This will default on new records, but show existing data on other modes.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Highlighted
Community Support
Community Support

Hi @whasmadi ,

Do you want to auto-populate the "CATEGORY OF WASTE" field in your custom form based on the selected Waste Code value?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Waste Code Dropdown box to following:

Distinct('Waste Code', Title)

set the Update property of the Waste Code field data card to following:

WasteCodeDropdownbox.Selectd.Result

 

Set the Default property of the "CATEGORY OF WASTE" field in the custom form to following:

If(
   SharePointForm1.Mode = FormMode.New,
   LookUp('Waste Code', Title = WasteCodeDropdownBox.Selected.Result, 'Category Of Waste'),
   Parent.Default
)

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

Hi @whasmadi ,

A couple of paths - please tag the one that suits your model.

Highlighted

Hi Kris,

 

Thanks for the suggestion, However, I got "Invalid argument" error when trying your method.

.

If(
SharePointForm1.Mode = FormMode.New,
LookUp('Waste Code', Title = Dropdown1.Selected.Result, 'Category Of Waste'),
Parent.Default
)

.

See the attached image.

.

Thanks.

Highlighted

hi Warren,

.

Thanks for the suggestion. However I still get Invalid Argument error using your formula.

.

Thanks

Highlighted

HI Kris,

.

I's managed to solve the problem by making minor change to your formula. Below is what is working for me now for the Category of Waste field:

.

Default = If (SharePointForm1.Mode = FormMode.New, LookUp ([@'Waste Code'], Title = Dropdown1.Selected.Result, 'Category Of Waste'), Parent.Default) 

Thanks

Highlighted

Hi @whasmadi ,

I was only demonstrating the syntax - I cannot see your data or form structure properly. This would have been sorted on the next reply once I knew this as I do not generally do lengthy assumptions and confuse people if I guess wrong.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,855)