cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Post Prodigy
Post Prodigy

StartWith has some invalid arguemnts

I have 2 drop-down fields (DataCardValue14 & DataCardValue15) and they contain options starting with numbers such as 1,2,3,4,5, etc..

 

and based on the selection of above 2 dropdowns >> i need to select the value of a third drop down >> so inside the 3rd dropdown i added this formula inside the Update field:-

 

If(StartsWith(DataCardValue14.Selected.Value,"1") && StartsWith(DataCardValue15.Selected.Value,"1"),"Low","High")

 

as follow:-

 

rf.png

 

but i got this error:-

 

StartWith has some invalid arguemnts

 

Any advice?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@johnjohn123 

Assuming the field you are trying to update is a choice column.

Change your formula to the following:

 

{Value:
    If(
       StartsWith(DataCardValue14.Selected.Value,"1") && 
       StartsWith(DataCardValue15.Selected.Value,"1"),
       "Low",
       "High"
    )
}

 

 

I hope this is helpful for you.

 

EDIT: Also, if you have your choice column set to allow multiple selections, then:

Table(
  {Value:
    If(
       StartsWith(DataCardValue14.Selected.Value,"1") && 
       StartsWith(DataCardValue15.Selected.Value,"1"),
       "Low",
       "High"
    )
  }
)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
gabibalaban
Super User
Super User

Hi @johnjohn123 ,

If your comboboxes have numbers as items, you should use Text function inside StartsWith:

If(StartsWith(Text(DataCardValue14.Selected.Value),"1") &&StartsWith(Text(DataCardValue15.Selected.Value),"1"),"Low","High")

 

You are trying to set the Update property of the datacard ? This way your third combobox will not be populated with any value. Use the defaultSelectedItem of the combobox.

 

Hope it helps !  

 

 

 

 

@gabibalabanI define your formula inside the DefaultSelectedItems but i got this error "Expected Table Value".. any idea?

RandyHayes
Super User
Super User

@johnjohn123 

Assuming the field you are trying to update is a choice column.

Change your formula to the following:

 

{Value:
    If(
       StartsWith(DataCardValue14.Selected.Value,"1") && 
       StartsWith(DataCardValue15.Selected.Value,"1"),
       "Low",
       "High"
    )
}

 

 

I hope this is helpful for you.

 

EDIT: Also, if you have your choice column set to allow multiple selections, then:

Table(
  {Value:
    If(
       StartsWith(DataCardValue14.Selected.Value,"1") && 
       StartsWith(DataCardValue15.Selected.Value,"1"),
       "Low",
       "High"
    )
  }
)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayesyour formula worked well for me .. thanks

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,323)