cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Carmen15
Helper IV
Helper IV

How to display automatically information into a form field in PowerApps?

Hi, 

Perhaps it is very easy what I am asking but it doesn't work for me. 

 

I have an edit form in Pow Apps connected to a SP List 1 where : 

- the field Plant is corresponding to a Choice column in the SP List 1

- the field Company Code is corresponding to a Single Text line column in SP List 1

In the Company Code field I want to bring the detail from  SP List 2 through a lookup thus in the end when I do a selection in Plant field to be automatically displayed the related detail in the Company Code field.

 

 

On the Company Code Default I put the formula : LookUp(SPList 2,Plant =ThisItem.Plant.Value ,CompanyCode)  , but it doesn't work. I tried with the formula : If( !IsBlank(DataCardValue4.Selected ),LookUp(SPList2,Plant= ThisItem.Plant.Value ,CompanyCode),Parent.Default)  , it doesn't work . Not sure where and what formula I should use.

 

If you are so kind to provide me some indication I would be very grateful. 

Thank you 

 

Additional Details:

 

SPList1 :

PlantCompany Code
AM01CO10
AM02CO10
AM03 CO11

 

SPLIst2:

Plant (Choices (AM01,AM02,AM03))Company Code (Single Text Line)
  
  
  
1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Carmen15 ,

 

According to your description, I've made a test for your reference:

1\ This is my SPList1. “ReceivingPlant” is a choice column.( The options in “ReceivingPlant” are: AE05 , AE06 , AE08). “ReceivingCompanyCode” is a Single line of text column.

v-xiaochen-msft_0-1608626871099.png

 

2\ This is my SPList2. “Plant” is a Single line of text column. “CompanyCode” is a Single line of text column.

v-xiaochen-msft_1-1608626871101.png

 

3\ Add an edit form control “Form1” an set its fields property like the picture.

v-xiaochen-msft_2-1608626871105.png

 

 

4\ Set ReceivingCompanyCode card’s textinput control’s Default property to:

LookUp(SPList2,Plant=DataCardValue1.Selected.Value).CompanyCode      // DataCardValue1 is the name of the combo box control. The combo box control is automatically generated by the ReceivingPlant field of the edit form.

 

5\ Add an Icon and set its onselect property to:

NewForm(Form1)

 

6\ Add an Icon and set its onselect property to:

SubmitForm(Form1)

 

7 The result is as follows:

 DDD.gif

152.PNG

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks

View solution in original post

5 REPLIES 5
v-xiaochen-msft
Community Support
Community Support

Hi @Carmen15 ,

 

Could you tell me:

  1. Is “Plant” a choice column in SPList1? Is “Plant” still a choice column in SPList2?
  2. What is the role of SPList2 ? What is the relationship between SPList1 and SPList2? Which list's Company Code column do you want to display? (In your formula, you use the lookup() function for SPList2. But the Company Code column has no value in SPList2 in your post. The records which Company Code column has value are in SPList1. I am confused about this.)
  3. What’s Item property of edit form control?

 

In addition, you could try the following code first:

LookUp(SPList 2,SPList2[@Plant].Value =ThisItem.Plant.Value ,CompanyCode)

 

Looking forward to your reply.

Best Regards,

Wearsky

Carmen15
Helper IV
Helper IV

Thank you for responding me! 

 

Below my answers with italic . 🙂

 

  1. Is “Plant” a choice column in SPList1? Is “Plant” still a choice column in SPList2? Plant is choice in SPList1 only. In SPList2 is Single Text Line filled with unique values.
  2. What is the role of SPList2 ? What is the relationship between SPList1 and SPList2? Which list's Company Code column do you want to display? (In your formula, you use the lookup() function for SPList2. But the Company Code column has no value in SPList2 in your post. The records which Company Code column has value are in SPList1. I am confused about this.) My edit form in Apps is displaying the columns from SPList1 . The Plant column in this list is choice and is containing  as options the same values from the SPList 2 . In the end I want to have 2 fields on my form where when I select a Plant automatically to be displayed the Company Code value  directly from the SPList2 . The SPList2 should be as a matrix for the Company Code column in SPList1. I need to mention also the followings : Company Code is Single Text Line column in both lists , Plant is choice in SPList1 but Single Line Text in SPList2 . Once summited the form (that refers to SPList1)  the Apps will create a new row in SPlist1 with the details I select in the form . The SPList2 is already filled with data : Pant has unique values , Company Code has not unique values.
  3. What’s Item property of edit form control? I didn't put anything in Item of edit form yet. Should I put any formula for auto-displaying  or something ? 

Thank you so much ! 

Looking forward for your reply!

Carmen 

Carmen15
Helper IV
Helper IV

SPList1 is looking like this : 

 

Carmen15_0-1608623986130.png

 

SPlist2 is looking like this : 

 

Carmen15_1-1608624006261.png

 

In the end I would like to have the Edit form like : 

(On Company Code to appear instantly the corresponding value from the SPList2 taking into consideration the value AE05 that I selected from choices on Plant. The Plant values are unique values , but the Company Code are not unique, so the field Company Code in the form should look at the values from the SPList2 but taking into account the values from the Plant ) 

Carmen15_2-1608624030024.png

 

I didn't put any formula on Item of the Edit form . Should I put any formula ? 

 

 

v-xiaochen-msft
Community Support
Community Support

Hi @Carmen15 ,

 

According to your description, I've made a test for your reference:

1\ This is my SPList1. “ReceivingPlant” is a choice column.( The options in “ReceivingPlant” are: AE05 , AE06 , AE08). “ReceivingCompanyCode” is a Single line of text column.

v-xiaochen-msft_0-1608626871099.png

 

2\ This is my SPList2. “Plant” is a Single line of text column. “CompanyCode” is a Single line of text column.

v-xiaochen-msft_1-1608626871101.png

 

3\ Add an edit form control “Form1” an set its fields property like the picture.

v-xiaochen-msft_2-1608626871105.png

 

 

4\ Set ReceivingCompanyCode card’s textinput control’s Default property to:

LookUp(SPList2,Plant=DataCardValue1.Selected.Value).CompanyCode      // DataCardValue1 is the name of the combo box control. The combo box control is automatically generated by the ReceivingPlant field of the edit form.

 

5\ Add an Icon and set its onselect property to:

NewForm(Form1)

 

6\ Add an Icon and set its onselect property to:

SubmitForm(Form1)

 

7 The result is as follows:

 DDD.gif

152.PNG

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks

You are awesome ! 

Thank you very much ! It is working! 🤗 

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.

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 (3,326)