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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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 (1,996)