question

BobMD-9765 avatar image
0 Votes"
BobMD-9765 asked JoyZ commented

SP online List column : set value base on user input

Hi
How do I set column value based on user input?

Example
if user selected Microsoft, then the browser column will set Edge value.
Google Chrome.


Thanks

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoyZ avatar image
0 Votes"
JoyZ answered

@BobMD-9765,

From your description, there is a choice column in the list, and you need to automatically update another column based on the value of the choice column.

We suggest you create a Calculated column to accomplish the work, simple test for your reference:

98978-image.png
Formula:

 =IF(Choice="Microsoft","Edge",IF(Choice="Test2","GoogleChrome",""))

Result:

98979-image.png

If this is not feasible for you, we can also use Microsoft flow to update specific column based on trigger.

99062-image.png

If it is true, use action "Update item" to update column:

99045-image.png

If it is false, add another condition, then update column to other value, if you have multiple selections, and so on:

99071-image.png

Result2:

99018-image.png


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (21.4 KiB)
image.png (6.4 KiB)
image.png (36.1 KiB)
image.png (73.3 KiB)
image.png (31.3 KiB)
image.png (9.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BobMD-9765 avatar image
0 Votes"
BobMD-9765 answered JoyZ commented

Thanks @JulieWang-MSFT for your reply.

What do you recommend for checking 60 items?

The calculate field can check 17 fields max.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BobMD-9765,

Calculated columns have no restrictions on items.

What do you mean calculated field can check 17 fields max?

Please feel free to reply.

0 Votes 0 ·
BobMD-9765 avatar image
0 Votes"
BobMD-9765 answered JoyZ commented

Hi @JulieWang-MSFT

This statement below is working fine. It will give me syntax error if I add one more
"if statement". (It will work again if I remove the 18th "if statement")

=if(FullName="bob","29A",
if(FullName="mary","REPORTERS",
if(FullName="soup","UNIT 4",
if(FullName="ann","UNIT 4",
if(FullName="kevin","UNIT 1",
if(FullName="smith","STAFF",
if(FullName="dean","UNIT 1",
if(FullName="cain","FORD",
if(FullName="ed","29A",
if(FullName="nancy","G41",
if(FullName="kay","UNIT 1",
if(FullName="tom","29A",
if(FullName="piit","UNIT 1",
if(FullName="pete","29A",
if(FullName="ellen","29A",
if(FullName="ken","UNIT 1","")
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BobMD-9765,

I have posted a new answer to your question, please check it .

0 Votes 0 ·
JoyZ avatar image
0 Votes"
JoyZ answered JoyZ edited

@BobMD-9765,

Per my test, there is a limit on the nested IF statements we can embed within the calculated formula, currently it is 19.

If I exceed this limit, I will occur error as shown below:

99996-image.png

As a workaround, we could use & operation to concatenate another if statements:

 if(FullName="bob","29A",
 if(FullName="mary","REPORTERS",
 if(FullName="soup","UNIT 4",
 if(FullName="ann","UNIT 4",
 if(FullName="kevin","UNIT 1",
 if(FullName="smith","STAFF",
 if(FullName="dean","UNIT 1",
 if(FullName="cain","FORD",
 if(FullName="ed","29A",
 if(FullName="nancy","G41",
 if(FullName="kay","UNIT 1",
 if(FullName="tom","29A",
 if(FullName="piit","UNIT 1",
 if(FullName="pete","29A",
 if(FullName="ellen","29A",
 if(FullName="ken","UNIT 1",
 if(FullName="Julie","Julie",
 if(FullName="emily","emily",
 if(FullName="Chelsea","chelsea","")))))))))))))))))))&if(FullName="Echo","echo","")

More information for your reference:

https://www.risual.com/2020/05/sharepoint-online-using-multiple-if-statements/

Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (11.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.