So I have a SPO list that uses other lists as lookups, and a PowerApps form/app to feed that list. LE is a variable I define thusly: Set(LE, Left(OwningOrg.Selected.Value, 3))
Compare the following 2 lines, the first has no error but sets the data source to a sub list, and the record does not get written to parent list, the second gives error 'invalid argument type' when I attempt to drill down to the lookup list column "legal_entity" yet the data source is correct ...
If(LE="EFS", Filter('BP Clients', Legal_Entity="EFS"), Filter('BP Clients', Legal_Entity="ESI"))
If(LE="EFS", Filter([@'B&P'].'BP Clients', Legal_Entity="EFS"), Filter([@'B&P'].'BP Clients', Legal_Entity="ESI"))
any help appreciated!
Solved! Go to Solution.
um yes I think...
So big picture I have a form that feeds a SPO list called B&P. One of it's columns is a lookup from another list named BP Clients. In the form when I choose Owning Organization, I want to filter the dropdown choices I see in BP Clients in light of the choice I made in the org. Your suggestion achieves this filtration perfectly.
When the form is complete with all required choices made, then saved, I want those values to show up in the B&P list item. This is not happening... at save the BP Clients column is left blank.
Okay...I believe we're there now. That is exactly what I had assumed, but I wanted to be clear before offering the next steps.
So, in regard to the next steps - this is an EditForm then we need to get your Default and Update properties set properly.
There are two primary properties for the data card - Default and Update. Default should be the value coming from the underlying datasource. IN your case, that should be ThisItem.BPClients
Now comes the next question...please clarify the name and the type of your dropdown (is it a Dropdown or a ComboBox?) Because the next steps will involve getting the value you have in the underlying record as the "Selected" item and then to get the Update property of the datacard to provide the correct information.
I'm using a combo box for the value named as BP_Clients.
If under Advanced Items I use "Choices([@'B&P'].'BP Clients') then under properties for Data source I see B&P. In this configuration there is no filtering of the dropdown but whatever choice I make in the field does save to the B&P list.
change items to "Filter(
'BP Clients',
Legal_Entity = If(StartsWith(OwningOrg.Selected.Value, "EFS"), "EFS", "ESI")
) "
and data type property changes to "BP Clients" and the record for BP Clients is not saved to the B&P list item.
I suppose conceptually the question boils down to how to read from one data source, then write the resultant value to another...
I understand that. We should be done with getting the items to display in the ComboBox now. Your formula should be the one we previously discussed, not the Choices function.
Items property formula:
Filter(
'BP Clients',
Legal_Entity = If(StartsWith(OwningOrg.Selected.Value, "EFS"), "EFS", "ESI")
)
The boiled down question is easily answered, but I need more information...
Questions remaining:
1) What is the name of the ComboBox? (in your BP Clients DataCard)
2) What is the Formula in the Default property of the DataCard for BP Clients?
3) What is the Formula in the Update property of the DataCard for BP Clients?
We have the items in the ComboBox showing the properly filtered values from the OwningOrg value at this point, we just need to adjust your Default properties and your Update properties so that the correct information is displayed and the correct information is stored.
yes formula is currently set to your suggestion.
1. The datacard name is BP Clients_Datacard1, and the combo box therein is named "BP_Clients".
2. default property for the Datacard "BP Clients_DataCard1" reads ThisItem.'BP Clients'
3. Update reads "BP_Clients.Selected
and by the way, I *really* appreciate your very kind and thoroughly didactic assistance!
Happy to help...and we should have the answer now! (fingers crossed).
For the DefaultSelectedItems property of the BP_Clients combobox, change the formula to the following:
LookUp('BP Clients', ID=Parent.Default.ID)
For the Update property of the BP ClientsDatacard1, set the formula to the following:
{
Value: BP_Clients.Selected.Title,
Id: BP_Clients.Selected.ID,
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
Let's see if that solves it.
hmmm.... attempting to set "DefaultSelcectedItems" for combo box BP_Clients to "LookUp('BP Clients' , ID=Parent.Default.ID) produces an error "Invalid argument type"
Actually, let's start simple instead - I was kind of jumping to the more tried-and-true forced record solution.
Let's set the DefaultSelectedItems property of the Combobox to the following:
Parent.Default
And the Update of the DataCard to the following:
BP_Clients.Selected
In most cases PowerApps will figure out the proper record structure on Submit, so let's first see if all of that is just working properly.
formula's don't error, but BP Clients isn't updated in B&P list on save
Okay...that technically should have worked, but let's jump to the Update property now.
Set the formula to the following:
{
Value: BP_Clients.Selected.Title,
Id: BP_Clients.Selected.ID,
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
252 | |
248 | |
85 | |
36 | |
31 |
User | Count |
---|---|
330 | |
260 | |
123 | |
69 | |
44 |