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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,168)