i have a hiding formula on the new entry form--=if([$StatusAnsuchen]=='Pending','false', 'true') that works fine so far. but now i´d like to add another statement based on other columns value (choice column)--=if([$Ansuchen]=='Andere','true', 'false') how can i add them together? i tried ...=if([$StatusAnsuchen]=='Pending','false', 'true' && [$Ansuchen]=='Andere','true', 'true')) but its not working...
thanks for any help
Solved! Go to Solution.
I am happy to help. However, can you post this new question in a separate thread?
This way we can separate the questions and solutions from each other. This also makes it a bit more reusable for the rest of the community 😀
You are talking about a conditional formula for a field in a SharePoint view, correct? This is not directly related to Power Automate but I will try and help you out anyway 😁
Can you try and use this formula instead?
=if([$StatusAnsuchen] == 'Pending' && [$Ansuchen] == 'Andere', 'false', 'true')
More examples can be found over here:
its me again...
it is possible with a formula to write value based on a choice field?ex.
=if([$Ansuchen]=='Weiterbildung', write value to field 'true', 'false')
That depends. Does your choice column allow the selection of multiple values?
That type is not supported:
A choice with a single value should work. In that same document they also have an example for that:
no selection multiple values.
but how do i compose the formula?
=if([$Ansuchen]=='Weiterbildung', write value to field 'true', 'false')...
the formula reference only if choice field and column have a certain value. ok that works.
but i need if choice is weiterbildung than add email address to field.
These example are only to show or hide fields, formulas for form configuation. I think you are now talking about different formulas, it sounds like you are now talking about calculated columns?
yes if i can reach my goal.
but i can´t find the right formula.
i have that text column called "Weiter". and a choice column mit choices.
can i add a calculated value in the column Weiter that looks at the choice column? ex.
if choice column is sharepoint than add value blablabla....
maybe i can achive this in flow?
but what is the formula there.? if ansuchen value= weiter than add email@example.com else use value.
or better in the grant access to an item section because i need it there
You could use an expression like below in the update item.
You might need to update the expression a bit. I am using a Get Item action.
if(equals(outputs('Get_item')?['body/Ansuchen/Value'], 'Weiterbilding'), 'firstname.lastname@example.org', 'Do nothing')
saving the flow gives me an error:
Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The action(s) 'Get_item' referenced by 'inputs' in action 'Update_item_2' are not defined in the template.'.'.
What is the name of the action you are using to collect the value of Ansuchen? In my case it is called Get Item. That might not be the case in your flow.
if(equals(outputs('Update_item_2')?['body/Ansuchen/Value'], is equal to 'Weiterbildung'), 'email@example.com', 'Do nothing') it gives the error "invalid expression...... i can´t save the formula.
There should be another action where you are getting the dynamic content fields like ID, ErstellDat from.
I am assuming this is either the trigger action like when item is created or some other action like Get Items, etc.
Can you share a screenshot of your whole flow setup. This will make it easier for me to come up with the correct expression 🙂
i added a get item action and used the expression. now it workes but the flow fails with applying the grant access items. when i use the choice weiterbildung everything works fine, when i user some of the other coices flow fails and grant access rights are not apllied.
The 'inputs.parameters' of workflow operation 'Grant_access_to_an_item_or_a_folder' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'parameter/recipients' is required to be of type 'String/email'. The runtime value '"firstname.lastname@example.org;email@example.com;Sharepoint-Genehmiger@test.com;Sharepoint-Finanzdienst@test.com;Sharepoint-Personalamt@test.com;;Do nothing"' to be converted doesn't have the expected format 'string/email'.
That is correct, the sample only works with the Weiterbildung choice. If you want it to work with other choices as well you need to amend the expression to meet that requirement.
Which other options do you have? And do they need to be mapped to the same e-mail address or to a different e-mail per choice option?
i have 4 choices "Aussendienst" - Weiterbildung - Abrechnung Aussendienst - Andere
the other 3 choices can mapped to the same email adress.
In that case you could just use the false part of the if function for those other three choices. Below is an example.
if(equals(outputs('Get_item')?['body/Ansuchen/Value'], 'Weiterbilding'), 'firstname.lastname@example.org', 'email@example.com')
@Kuno66, you can amend the expression to use nested if functions. But the expression becomes a bit longer:
if(equals(outputs('Get_item')?['body/Ansuchen/Value'], 'Weiterbilding'), 'firstname.lastname@example.org', if(equals(outputs('Get_item')?['body/Ansuchen/Value'], 'Aussendienst'), 'email@example.com', if(equals(outputs('Get_item')?['body/Ansuchen/Value'], 'Abrechnung Aussendienst'), 'firstname.lastname@example.org', 'email@example.com')))
Or another approach would be to use a mapping array and filter that array based on that Ansuchen Value. I would suggest that approach when the amount of choices is a bit more.
Check out the News & Announcements to learn more.
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Check out our new Discover Your Career Path blog post series and get all the details.