cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lennova
Helper I
Helper I

Pass information from hidden form controls to lookup columns in SP

Hi, 

 

I have a screen used by the end user to enter information about an internal request for one of our clients.

 

I have a combobox (DataCardValue1) in a form with client names pulled from SP list 'Accounts' and I have a dropdown (ddDBSelect) containing deliveries for that client derived from the selected client.

 

On the same screen I have a second form containing details of the internal request.

In that screen I also have hidden controls for the selected client and selected delivery. They are hidden so they are also saved in the task SP list in lookup columns.

 

The client is saved when submitting the form but the delivery isn't.

 

Form Accounts, DataCardValue1, items: Choices([@Task].Account)

Dropdown ddDBSelect, items: Filter(Databases,Account.Value=DataCardValue1.Selected.Value)

Form TaskInfo, Account_DataCard, default: DataCardValue1.Selected

Form TaskInfo, Delivery_Datacard, default: ddDBSelect

 

My Delivery_DataCard is showing the name of the selected delivery but it isn't going through to my SP list when I submit the form.

 

Any ideas? Have tried using a combobox instead of a dropdown for my filtered deliveries list, have tried using the id from the SP list to pass the information. Both aren't working.

 

Regards,

Hans

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Lennova 

Since your Items property is:

    Filter(Databases,Account.Value=DataCardValue1.Selected.Value)

This will contain a full record from Databases - which is not compatible with a Lookup record.

 

So what you need to supply in your Update is a record with an Id and Value column.  Where the Value comes from is dependent on how you have defined your Lookup column.  If you have the default, then the looked up value is going to be the Title from the other list.

In that case, you would change your Update property to:

With(ddDBSelect.Selected,
   {Id: ID, 
    Value: Title
   }
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Lennova 

What is the Update property of the Datacard??  That is what governs what is written on a Submit.

 

Check that formula and make sure it is referencing the control value you want.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi Randy,

 

Thanks for the quick reply!

 

I have tried 4 things and none of them worked ddDBSelect, ddDBSelect.Selected, ddDBSelect.SelectedText didn't give an error but didn't pass anything, ddDBSelect.Selected.Delivery gave an "Expected: Record value" error.

 

Any other things I can try?

RandyHayes
Super User
Super User

@Lennova 

Since your Items property is:

    Filter(Databases,Account.Value=DataCardValue1.Selected.Value)

This will contain a full record from Databases - which is not compatible with a Lookup record.

 

So what you need to supply in your Update is a record with an Id and Value column.  Where the Value comes from is dependent on how you have defined your Lookup column.  If you have the default, then the looked up value is going to be the Title from the other list.

In that case, you would change your Update property to:

With(ddDBSelect.Selected,
   {Id: ID, 
    Value: Title
   }
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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,615)