cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
R3dKap
Level 10

Re: Update a drop down list when a date is entered

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.

AB12
Level: Powered On

Re: Update a drop down list when a date is entered

Hi,

 

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 ?

 

Thanks

A

R3dKap
Level 10

Re: Update a drop down list when a date is entered

Hi @AB12,

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

Emmanuel

R3dKap
Level 10

Re: Update a drop down list when a date is entered

I won't let you down until we resolve your issue... 🙂

AB12
Level: Powered On

Re: Update a drop down list when a date is entered

Hi Emmanuel,

 

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.

 

Many thanks

A

 

R3dKap
Level 10

Re: Update a drop down list when a date is entered

Hi @AB12,

Ok, here is what I've been able to do so far:

ab12.gif

Is this what you want to do ?

AB12
Level: Powered On

Re: Update a drop down list when a date is entered

Hi,

Yes, that looks great!

 

😊

R3dKap
Level 10

Re: Update a drop down list when a date is entered

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...

View solution in original post

AB12
Level: Powered On

Re: Update a drop down list when a date is entered

It works!

Many, many thanks for helping me with this and for your perseverance - it is much appreciated. 

R3dKap
Level 10

Re: Update a drop down list when a date is entered

Ah ! At last ! 😀

Glad I could help you... 😊

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,714)