Arrrgh ! Yes, sorry... I know what's the problem... The Mode property of the SharePointForm1 control is of type enum, but the values in the enum FormMode return integers. So you need to change you formula to this:
LookUp(Choices([@'Log Requests'].Request_x0020_stage), Value= Switch(SharePointForm1.Mode, 1, "New", 0, If( Not(IsBlank(DataCardValue19.Text)), "Tested", Not(IsBlank(DataCardValue17.SelectedDate)), "Transferred", Parent.Default.Value ), 2, Parent.Default.Value ) )
At least this will be solved. Maybe there could still be some errors. But if you can already try this and tell me how it goes... Thanks.
I am really sorry but I am still experiencing error messages:
'The function if has home invalid arguments'
'The function Switch has home invalid arguments'
'Invalid number of arguments: received 5 excpected1'
I have attached a screen grab too.
Am I doing something daft when I copy the code? DO you have any thoughts on how to resolve this ?
No you're not doing anything wrong when you copy the formula. The thing is that it is very complicated to post formulas without testing them. And testing the formulas means I would have to reproduce your case by creating a SharePoint list, customize the form and test the formula. Since this takes quite some time, it is not always easy to find that time. I am at work now. I will try to find some time to reproduce your case tonight and provide you with the working solution for tomorrow. Is that ok with you ?j
Thank you, I am so grateful, I wouldn't know where to start without your help! I am very happy to wait for your next message / coding test for me to do.
Ok, perfect. So here is the formula:
If( SharePointForm1.Mode = FormMode.New, LookUp( Choices(AB12.Stage), Value = "New" ), SharePointForm1.Mode = FormMode.View, Parent.Default, SharePointForm1.Mode = FormMode.Edit, If( Not(IsBlank(DataCardValueTestCompletedBy.Text)), LookUp( Choices(AB12.Stage), Value = "Tested" ), Not(IsBlank(DataCardValueTransferredToFieldDate.SelectedDate)), LookUp( Choices(AB12.Stage), Value = "Transferred" ), Parent.Default ) )
Just replace AB12 with the name of your datasource, Stage with the name of your stage field, DataCardValueTestCompletedBy and DataCardValueTransferredToFieldDate with the name of your corresponding datacard values.
Tell me how this goes...
Check it out!
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
The largest Power BI, Power Platform, and Data conference in New Zealand