Hello, I am new at this. Please help me if you can.
The goal: When a new item is added to Lists (There is already an automation- with the new items on Lists are created by submitted forms) a Choice is automatically selected based on what is in Column "Country".
If Column "Country" Has one of the following:
-DE
-IT
-UK
-FR
Then Column "Status" will have: "Input Required"
If Column "Country" has a different variable than above, Column "Status" will have: "N/A"
Kind Regards,
Holly
Solved! Go to Solution.
@HollyNewell what is the name of your country column? You will need to use internal name of your country column instead of 'text' in the below expression
if(contains('-DE -IT -UK -FR', triggerBody()['text']), 'Input Required', 'n/a')
to get internal name of your column "Go to your List Settings, then click on the specific column, then look at the browser URL, take the name what appears after the Field=
E.g. http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099... is my URL when I click on Link field in List Settings, here my internal field name is Link, which I will use in the expression."
@HollyNewell so you want to set value of column status based on country column value when new item is created in list? If yes, then create a flow with trigger when item is created, then add condition action to check value of country column, and in the yes and no branch of condition add update item action to update value of status column.
Hi, @HollyNewell , I guess my main question is:
Do you intend to use the "Status" column for anything else?
I ask this because ( purely based on the above ) I see a binary situation there. It's either that input is needed, or not.
Purely SharePoint Solution
Columns
I have made three columns:
Single Line of Text - Country
inputRequired - Calculated Yes/No - This uses a formula to define if it is Yes or No.
Status - Calculated Single Line of Text - This could use the same formula as inputRequired, but I decided to base it on that field for variety.
Formulas
For the 'Yes/No' calculated column 'inputRequired' I used this formula:
=OR(EXACT(Country,"-DE"),EXACT(Country,"-IT"),EXACT(Country,"-UK"),EXACT(Country,"-FR"))
I used this code for the formatting:
{"elmType":"div","style":{"box-sizing":"border-box","padding":"0 2px"},"attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField",true]},"sp-css-backgroundColor-blockingBackground50",{"operator":":","operands":[{"operator":"==","operands":["@currentField",false]},"sp-css-backgroundColor-successBackground50",""]}]}},"children":[{"elmType":"span","style":{"line-height":"16px","height":"14px"},"attributes":{"iconName":{"operator":":","operands":[{"operator":"==","operands":["@currentField",true]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",false]},"",""]}]}}},{"elmType":"span","style":{"overflow":"hidden","text-overflow":"ellipsis","padding":"0 3px"},"txtContent":"@currentField.displayValue","attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField",true]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",false]},"",""]}]}}}],"templateId":"BgColorBoolean"}
For , the Single Line of Text calculated column I used this formula:
=IF(EXACT(requiresInput,TRUE),"Input Required","n/a")
I used this code for the formatting:
{"elmType":"div","style":{"flex-wrap":"wrap","display":"flex"},"children":[{"elmType":"div","style":{"box-sizing":"border-box","padding":"4px 8px 5px 8px","display":"flex","border-radius":"16px","height":"24px","align-items":"center","white-space":"nowrap","overflow":"hidden","margin":"4px 4px 4px 4px"},"attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","Input Required"]},"sp-css-backgroundColor-blockingBackground50",{"operator":":","operands":[{"operator":"==","operands":["@currentField","n/a"]},"sp-css-backgroundColor-successBackground50",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"","sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary"]}]}]}},"children":[{"elmType":"span","style":{"line-height":"16px","height":"14px"},"attributes":{"iconName":{"operator":":","operands":[{"operator":"==","operands":["@currentField","Input Required"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","n/a"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"",""]}]}]}}},{"elmType":"span","style":{"overflow":"hidden","text-overflow":"ellipsis","padding":"0 3px"},"txtContent":"@currentField","attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","Input Required"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","n/a"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"",""]}]}]}}}]}],"templateId":"BgColorChoicePill"}
I didn't make those formatting codes myself, for the text field I created a separate choice field with the exact same values it calculates, then copied the automated formatting that the modern SharePoint site does for it. For the Yes/No, you can edit it by right clicking the column when looking at the list.
Power Automate Solution
If I'm reading this correctly, you already have a flow that is handling this, you can go one of two ways:
Full flow logic is the easiest to understand because you can see it all visually, but I'll flesh both of these out with a couple of examples in a bit, but hopefully I've plotted them out enough for you to work out the rest.
If you respond, I'll reply again, otherwise I'll edit more into this reply myself. 🙂
Hi, @HollyNewell , I guess my main question is:
Do you intend to use the "Status" column for anything else?
I ask this because ( purely based on the above ) I see a binary situation there. It's either that input is needed, or not.
Purely SharePoint Solution
Columns
I have made three columns:
Formulas
For the 'Yes/No' calculated column 'inputRequired' I used this formula:
=OR(EXACT(Country,"-DE"),EXACT(Country,"-IT"),EXACT(Country,"-UK"),EXACT(Country,"-FR"))
I used this code for the formatting:
{"elmType":"div","style":{"box-sizing":"border-box","padding":"0 2px"},"attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField",true]},"sp-css-backgroundColor-blockingBackground50",{"operator":":","operands":[{"operator":"==","operands":["@currentField",false]},"sp-css-backgroundColor-successBackground50",""]}]}},"children":[{"elmType":"span","style":{"line-height":"16px","height":"14px"},"attributes":{"iconName":{"operator":":","operands":[{"operator":"==","operands":["@currentField",true]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",false]},"",""]}]}}},{"elmType":"span","style":{"overflow":"hidden","text-overflow":"ellipsis","padding":"0 3px"},"txtContent":"@currentField.displayValue","attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField",true]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",false]},"",""]}]}}}],"templateId":"BgColorBoolean"}
For , the Single Line of Text calculated column I used this formula:
=IF(EXACT(requiresInput,TRUE),"Input Required","n/a")
I used this code for the formatting:
{"elmType":"div","style":{"flex-wrap":"wrap","display":"flex"},"children":[{"elmType":"div","style":{"box-sizing":"border-box","padding":"4px 8px 5px 8px","display":"flex","border-radius":"16px","height":"24px","align-items":"center","white-space":"nowrap","overflow":"hidden","margin":"4px 4px 4px 4px"},"attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","Input Required"]},"sp-css-backgroundColor-blockingBackground50",{"operator":":","operands":[{"operator":"==","operands":["@currentField","n/a"]},"sp-css-backgroundColor-successBackground50",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"","sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary"]}]}]}},"children":[{"elmType":"span","style":{"line-height":"16px","height":"14px"},"attributes":{"iconName":{"operator":":","operands":[{"operator":"==","operands":["@currentField","Input Required"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","n/a"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"",""]}]}]}}},{"elmType":"span","style":{"overflow":"hidden","text-overflow":"ellipsis","padding":"0 3px"},"txtContent":"@currentField","attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","Input Required"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","n/a"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"",""]}]}]}}}]}],"templateId":"BgColorChoicePill"}
I didn't make those formatting codes myself, for the text field I created a separate choice field with the exact same values it calculates, then copied the automated formatting that the modern SharePoint site does for it. For the Yes/No, you can edit it by right clicking the column when looking at the list.
Power Automate Solution
If I'm reading this correctly, you already have a flow that is handling this, you can go one of two ways:
Flow
I used the array option in the condition:
Expression
It's actually a pretty simple expression, only using two functions:
if(contains('-DE -IT -UK -FR', triggerBody()['text']), 'Input Required', 'n/a')
----
Full flow logic is the easiest to understand because you can see it all visually, but the expression is definitely simpler ... however the pure SharePoint version eliminates any need at all. However you can't then power further actions in your existing flow with those updates, unless you retrieve the item at the start of the flow.
DELETE
DELETE
Thank you for your reply,
Maybe I am too new at this, as much of what you say does not make sense to me.
The sharepoint solution doesnt make sense to me- As there is two columns in my situation, not three.
I started to do your full flow logic solution, this makes more sense to me, but it is not working.
I cannot find and select the Country column on my List page.
This is what happend when I tried your Expression:
The Flow failed.
These are all the column I have.
when "DE, FR, IT, UK" are in the "Country" Column. the "Backoffice STATUS" to say "Input required"
This Backoffice status will eventually be changed manually to "Complete" - Will this cause a problem?
@HollyNewell what is the name of your country column? You will need to use internal name of your country column instead of 'text' in the below expression
if(contains('-DE -IT -UK -FR', triggerBody()['text']), 'Input Required', 'n/a')
to get internal name of your column "Go to your List Settings, then click on the specific column, then look at the browser URL, take the name what appears after the Field=
E.g. http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099... is my URL when I click on Link field in List Settings, here my internal field name is Link, which I will use in the expression."
Hello, I have added the URL of the Country column. but it is saying it does not exist. I have put the full URL as well as like: "List=%7BD192496B%2D315E%2D4959%2D8464%2D37C4538FE62A%7D&Field=Country"
I have solved this by just putting "Country" in there, there is no need for the URL.
This is now working. however, if there is a different country (other than DE IT FR UK) in the country column I would like it to show "N/A". This expression i used is only bringing up when input is required and I need it to do both please
I'll try to catch up with all this tomorrow, @HollyNewell , in the meantime, I'm glad you have some functionality. 🙂
User | Count |
---|---|
93 | |
44 | |
21 | |
20 | |
16 |
User | Count |
---|---|
137 | |
56 | |
46 | |
36 | |
26 |