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

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

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

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.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,504)