Hi Folks -
I'm trying to patch a record from one list to another list. The unfortunate thing is, one of the fields I am trying to patch to has 20 values. Is there a way to get the value from the source list and then scan the target ComboBox box for the value and return the ID, set as a variable and then use that in my Patch command?
Otherwise, i was thinking making a formula to check value I'm using in my Patch and set the appropriate ID into a variable So for instance, instead of Id=1 I'd use Id=varValue.
Patch(rdInvestments,{Device_Flag:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:1,Value:"TRUE"},ProjectCode:"TEMPNAME"})
The only issue is if I add a new Choice value, I need to update the formula. I'm hoping there is a way to get the ID dynamically. Any thoughts? Thanks!
A combobox with single item selection stores as a record:
{Value: <Value>}
A combobox multiple select stores as a table:
[Id: <Id>, Value: <Value>,Id: <Id>, Value: <Value>,...]
So you can get the items from source combobox in a table variable, update it with new values if required, and while patching, provide this table as source in the formula.
Eg:
Patch(rdInvestments,{Device_Flag:source_table});
Hope this gives you a hint to solve your issue.
@Anonymous Hmmm, I'm not really following. Let me explain.
Powerapps is my Master Data Management Platform where users enter New and Change Requests to existing data elements that are importing into our Financial Applications.
For Change Requests, the EditForm opens and depending on what field they change, I need to update another SP list as a couple of our data elements are linked as one represents early discovery while one represents development. The field I am changing has the same list of values as the field I'm trying to update in the other form and they are named the same as well.
The field has 20 values. Let's say I made a new single Selection to "Value6" and now I want to update the target field with the same "Value6". How do I dynamically get the ID of 6 (or whatever it is) so I can patch to the Target? As based on my research, I need both the ID and the actual value to patch.
I was thinking making an If statement to say if value = "Value6" then Set(strIDValue,"6") and then use that variable for the Id portion of the Patch logic...I was hoping there was a more dynamic way.
Here is an example of what I'm trying to do. Source and Target represent my SharePoint lists. Note, I already have the logic to join the records to ensure I'm updating the correct one.
Field_Example Values | |
Alligator | 1 |
Cat | 2 |
Bird | 3 |
Dog | 4 |
Deer | 5 |
Moose | 6 |
And then here would be my logic...So my question is, how do I get "6" dynamically? And obviously, "Moose" will be represented by a DataCardValueXX.Text logic. I have it hard coded here only for example purposes.
Patch(
rdInvestments,
LookUp(rdAssets, Research_Code=Right(DataCardValue100.Text),
{Device_Flag:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:6,Value:"Moose"}}
);
User | Count |
---|---|
251 | |
250 | |
82 | |
45 | |
27 |
User | Count |
---|---|
350 | |
265 | |
127 | |
60 | |
58 |