cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AB12
Level: Powered On

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

Hi,

I am really sorry to re-open this query, but the user has come back with additional requirements, in addition to looking for blank fields - which I now have the coding for (thank you) - they want the Stage updated where an Or statement is needed and also where the fields will not be empty before the data is entered.

The Data cards in question are DataCardValue7 (Choice) and DataCardValue23 (date and time). The choices for DataCardValue7 are 'Select an option', 'CD', ' IRA' and 'EIR'. DataCardValue23 is blank until the date is entered. DataCardValue7 will be completed before DataCardValue23 so the ticket may never reach DataCardValue23 . Should 'Select an Option' or 'CD' be entered or the date entered in to DataCardValue23 the Stage should be changed to 'Complete'.

I have tried to amend your coding to accommodate the new requirements but have been unsuccessful with whatever I try.

What I have done is add the following after 'Value = "Transferred"), ' and before the final ' Parent.Default)) '

Not((DataCardValue7.Selected.Value = "CD"), Lookup(Choices(AB12.Stage), Value = "Completed"),

((DataCardValue7.Selected.Value = "Select an option"), Lookup(Choices(AB12.Stage), Value = "Completed"),

 

I have tried making this an 'If / Or' statement but nothing is successful - I just get warning messages and the code is underlined in red.

I haven't tried adding DataCardValue23 into the formula yet - I think it sensible to work out how to do DataCardValue7 first.

 

Can anyone help me with this please? 

BTW I am happy to open a new query if necessary.

 

Many thanks

 

A

 

 

 

R3dKap
Level 10

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

Hi @AB12,

If I understand your new need here: DataCardValue7 and DataCardValue23 are two new conditions for setting the staging field to Completed:

  • if DataCardValue7 is Select an option or CD, then the staging field should be set to Completed
  • if DataCardValue23 date is entered, then the staging field should also be set to Completed

Is that it ?

AB12
Level: Powered On

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

Hi,

 

Yes that is correct. I thought it would be a straightforward "if(or" statement but - well obviously - I can't work out how to do it.

 

BTW I am now working on what will hopefully be the production site so I will take your advice on board and label the data card values appropriately before I start the coding.

 

Many thanks

R3dKap
Level 10

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

Ok, so the formula should now be:

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"
        ),
        DataCardValue7.Selected.Value = "Select an option" || DataCardValue7.Selected.Value = "CD" || Not(IsBlank(DataCardValue23.SelectedDate)),
        LookUp(
            Choices(AB12.Stage),
            Value = "Completed"
        ),
        Parent.Default
    )
)

I haven't tested it though...

"...I will take your advice on board and label the data card values appropriately...👍👌👏

AB12
Level: Powered On

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

Hi,

Thank you for your coding suggestion but I'm afraid that I get error messages - The "function 'If' has some invalid arguments", "Invocation of unknown or unsupported arguments" and "The function 'IsBlank' has some invalid arguments".

 

Any thoughts?

Thanks

A

R3dKap
Level 10

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

Can you tell me on which IsBlank there is the error ? Or post here a capture of the whole formula...

AB12
Level: Powered On

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

Hi,

It is the ||Not(IsBlank(DataCardValue23.SelectedDate)) which is causing the error - when I blank it out that section of the coding I get no error warnings however the value does not update to "Complete"  when it should. I have attached a screen grabs of both sets of coding (with and without blocked out coding).

 

Thanks

 

R3dKap
Level 10

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

I'm sure you can find the error yourself if you look closely at what you wrote in your formula... 😏

AB12
Level: Powered On

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

- opps - I can't type (or code!) - I have been looking at the screen for so long I missed it 😥

 

 - thanks

R3dKap
Level 10

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

No problem... 😉

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (3,821)