Hi,
I'm just trying to make a data card here where it should store it's according value:
The reason I'm doing this is I need to make a more user-friendly combobox where they can also see who's the manager of the cost center, not only their numbers.
But I'm using 'Cost Center' value in my flow without the managers' names, so I would like to make it auto-selected based on ccValuewithManagerName, and just make 'Cost Center' data card invisible.
But I'm getting errors here. Can someone help me out with this? thank you!
+) Both 'Cost Center' and 'ccValuewithManagerName' is the columns in sharepoint list with Choices data type.
Based on what you described, I assume you are trying to set the value of a ComboBox (or other data card) based on another ComboBox's selected value in Power Apps Canvas App, using Power Fx.
Specifically, you want to set the 'Cost Center' value based on the selected 'ccValuewithManagerName' value.
If I understand correctly, you're trying to auto-fill the 'Cost Center' field whenever a manager is selected in the 'ccValuewithManagerName' ComboBox.
Here's a possible solution. In the formula bar for the 'Cost Center' ComboBox's DefaultSelectedItems property, you can reference the 'ccValuewithManagerName' ComboBox's selected item.
In Power Fx, you might write something like this:
{Value: ccValuewithManagerName.Selected.Manager}
This formula implies that the 'ccValuewithManagerName' ComboBox has a column called 'Manager' that corresponds to a value in the 'Cost Center' ComboBox.
When a user selects an item in the 'ccValuewithManagerName' ComboBox, the 'Cost Center' ComboBox will automatically select the manager associated with that item.
However, if you're getting a red squiggle error on "2011-", it seems like Power Apps is not recognizing this as a valid choice in your 'Cost Center' field. You may want to check if this value exists in your 'Cost Center' field. If it does not exist, then that would explain why you are seeing the error.
In Power Fx, a common issue when dealing with strings and Choice fields in SharePoint is that the value you are trying to use is a string, but the Choice field expects a record.
In Power Apps, SharePoint Choice columns are represented as a table, with each choice represented as a record with properties like Value, Id, etc. So when you are trying to set the value of a Choice field, you should be providing a record that matches the structure expected by the field, not just a string.
For instance, if you are trying to set the value of your Choice field ('Cost Center' or 'ccValuewithManagerName') to "2011-", you need to use the correct record structure, something like this:
{Id:1, Value:"2011-"}
The Id you provide should match the Id of the choice in the SharePoint list.
In case, if you want to look up the record based on the Value, you can use the LookUp function, like this:
LookUp(Choices('Your SharePoint List'.'Cost Center'), Value = "2011-")
Replace 'Your SharePoint List' with the actual name of your SharePoint list.
If you continue to see an error, it's likely that "2011-" does not exist as a choice in your SharePoint column. You will need to verify the choices in your SharePoint column and ensure that the value you are trying to use does indeed exist there.
See if it helps @pinball2
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
58
Michael E. Gernaey
42
Super User 2025 Season 1