cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sujesth
Regular Visitor

get lookup field to save in form

I have a field in my form (Card B) that defaults to a value based on the entry in Card A via the LookUp function. When I select my entry in Card A (from a dropdown list), the field in Card B updates as it should, updates accordingly in the gallery and saves to the backend list in SharePoint, but when I come back to the item (via the gallery), the Card B field is empty. How can I get this to save in the form?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @sujesth ,

You can try this in the Default

Coalesce(
   LookUp(
      'APC', 
      field_1 = DataCardValue101.Selected.field_1
   ).field_2,
   ThisItem.'Plant Code_'
)

 

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.

Visit my blog Practical Power Apps

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

HI @sujesth ,

You did not say what type of control is in Card B (text box/ dropdown etc) - assuming it is a Text box, what is the Default and what is the name and type of field it is writing back to? 

sujesth
Regular Visitor

Yes, Card B is a text field. A LookUp formula is set up in the Power Apps from as the Default value for Card B. Not sure I understand your question about the name and type of field it’s writing back to. The text box in Card B is set up to show the corresponding abbreviation for the selection made in Card A - e.g. if I select “Watermark” from my drop down in Card A, then the text box in Card B will say “WTM”.  Watermark and WTM will save to the Sharepoint list, but when I come back to this item via the gallery in Power Apps, Watermark is displayed but the WTM box is blank. 

Hi @sujesth ,

Your issue will be the Default of the Text Box in Card B and I need the code (in Text please) currently in it. I also need the name and type of field in SharePoint that this text box is saving its data to. Can you also include the code in the Update of Card B

sujesth
Regular Visitor

The Default of the Text Box in Card B is: LookUp('APC', field_1 = DataCardValue101.Selected.field_1, field_2) and the Update of Card B is: DataCardValue102.Text. The name of the field in SharePoint that the text box is saving data to is Plant Code_ and it is a (single line of) text field.

Hi @sujesth ,

You can try this in the Default

Coalesce(
   LookUp(
      'APC', 
      field_1 = DataCardValue101.Selected.field_1
   ).field_2,
   ThisItem.'Plant Code_'
)

 

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.

Visit my blog Practical Power Apps

sujesth
Regular Visitor

You're amazing! Works like a charm! THANK YOU!!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,670)