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 III
Super User III

@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

View solution in original post

4 REPLIES 4
gabibalaban
Super User II
Super User II

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 III
Super User III

@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

View solution in original post

@RandyHayesyour formula worked well for me .. thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (65,929)