Forum Discussion
Automatically assigning a value based on another column value
NicosAcuna well you could do it with a Switch control in Power Automate as you would be just inside the 27 case limit, but it's more work than having a calculated column using multiple If expressions. So your department column would be a choice column then you'd add the following formula to your DeptID calculated column:
=If(Department="HR",1,If(Department="Operations",2,If(Department="Warehouse",3,"")))
etc etc.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
RobElliott I have a list grouped by State and I want to add a Solution ID column that I want to populate a unique ID based on the state selected. This does not seem to be working for me. How can I accomplish? All states have a unique ID # that is 15 numbers long. =IF(State=“AL”,201028145313666,IF(State=“AK”,201028145313777,”)
- Rob_ElliottFeb 28, 2024Bronze Contributor
HugoVital I assume by "Solution ID column" you mean a calculated column. You need to use a formula like this:
=IF(State="AL","201028145313666",IF(State="AK","201028145313777",IF(State="AZ","196745986234901","0")))Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)- HugoVitalFeb 28, 2024Copper Contributor
Rob_Elliott I get a message stating “The validation formula can refer to this column and not others.” I am using a Choice column by the way.
- ganeshsanapFeb 29, 2024MVP
I think you are trying to add the formula in Column Validation section of existing column - which is causing this error.
As per the suggestion by Rob_Elliott, you have to create a new calculated column with the formula. Check: Create a column in a list or library
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.