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

Form value from another data source not updating

Greatings experts,

 

I have a form connected to a sharepoint list (VM-resources) and in one of the Cards I've changed the "update" property to "DataCardValue36.Selected"

 

This Datacard value is a combobox with the Items property referring to two different Sharepoint Lists with the following code:

 

If(
LookUp(
'vm-Access',
Title = varOwner,
Company
) = "Vendor1",
Distinct(Filter(ListProjects,"Vendor1" in Vendor),ProjectNumber),
If(
LookUp(
'vm-Access',
Title = varOwner,
Company
) = "Vendor2",
Distinct(Filter(UniquePTs,"Vendor2" in Vendor),ProjectNumber),
Distinct(ListProjects,ProjectNumber)
)
)

 

The combo box is retrieving correctly the ProjectNumbers of the correct Vendor currently logged but for some reason its not passing the selected value to the Sharepoint List "VM-resources"... 

 

For what I understood it should be possible to populate combobox from one form with data from different datasources... 

 

Anybody can give me a little help? Thank you for your time!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @JMHenry ,

Firstly, you can save a bit of code on the first bit

With(
   {
      wRecord:
      LookUp(
         'vm-Access',
         Title = varOwner
      ).Company
   },
   If(
      wRecord = "Vendor1",
      Distinct(
         Filter(
            ListProjects,
            "Vendor1" in Vendor
         ),
         ProjectNumber
      ),
      wRecord = "Vendor2",
      Distinct(
         Filter(
            UniquePTs,
           "Vendor2" in Vendor
         ),
         ProjectNumber
      ),
      Distinct(
         ListProjects,
         ProjectNumber
      )
   )
)

but the main thing here is that you are returning a table value of Result. You did not say what type of field you are writing back to, but two possibilities - if it is a Text column, you just need

DataCardValue36.Selected.Result

If a Choice column, you need

{Value:DataCardValue36.Selected.Result}

I am assuming in all of this that it is a single-select combo box.

 

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

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @JMHenry ,

Firstly, you can save a bit of code on the first bit

With(
   {
      wRecord:
      LookUp(
         'vm-Access',
         Title = varOwner
      ).Company
   },
   If(
      wRecord = "Vendor1",
      Distinct(
         Filter(
            ListProjects,
            "Vendor1" in Vendor
         ),
         ProjectNumber
      ),
      wRecord = "Vendor2",
      Distinct(
         Filter(
            UniquePTs,
           "Vendor2" in Vendor
         ),
         ProjectNumber
      ),
      Distinct(
         ListProjects,
         ProjectNumber
      )
   )
)

but the main thing here is that you are returning a table value of Result. You did not say what type of field you are writing back to, but two possibilities - if it is a Text column, you just need

DataCardValue36.Selected.Result

If a Choice column, you need

{Value:DataCardValue36.Selected.Result}

I am assuming in all of this that it is a single-select combo box.

 

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

JMHenry
Frequent Visitor

Hi @WarrenBelz ,

 

Many thanks for the help. Unfortunatly still not joy..  but probably because of the type of column since its a lookup column... Its a lookup because I initial was using it to retrieve all the possible Unique project Numbers from the other list. But I believe now I can change this but it will take a lot of extra work... 

 

I've used "{Value:DataCardValue36.Selected.Result}" and its accepted but it doesn't save it... I'm searching for the correct way to do this with lookup columns but I still didn't found a solution. 

 

Update: I've created a new text column just to try it but still no luck... I've changed the card datafield to the new text column. But I'm still unable to change the update function to "DataCardValue36.Selected.Result" it just says it got an error... It continues to expect something like a choice column... also in the "default" function I changed it to reflect the new text Column (ThisItem.PTNumber) and it gives another strange errors saying its using scope... 

Hi @JMHenry ,

I am hoping you were not going to say that - Lookup columns will cause you many levels of grief in Power Apps that you simply do not need (I have not used them for many years). You actually need to find and patch back also the ID of the record in the other list you are looking up (so what you are patching need to be there). If it is there you need

{
   Value:DataCardValue36.Selected.Result,
   Id:
   LookUp(
      YourOtherList,
      YourLookedUpFieldName = DataCardValue36.Selected.Result
   ).ID
}

NOTE the two different references to ID/Id

 

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

 

JMHenry
Frequent Visitor

Hi @WarrenBelz ,

 

Many many thanks. Yesterday I read a little more about lookup columns and I got to the same conclusions... I basically created a new text column and used your initial solution (also already accepted it as the solution). 

 

many thanks for your time and support 🙂 

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 (4,487)