cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LukasSliuzas
Helper II
Helper II

Update text input field depending on selection

Hello,

 

I am still learning the powerapps syntax and how to do stuff and currently stuck on this issue.

 

I got drop down menu with multiple choices but when choice "Other" is selected text field appears and I need information to be sended to SP list.

 

I tried writing like this:

 

If(DataCardValue3.Selected.Value = "Andere", TextInput1.Text, DataCardValue3.Selected.Value) But I am getting an error with this. 

 

Of cource it would be perfect if it printer this to the list: DataCarKey3 - TextInput1

1 ACCEPTED SOLUTION

Accepted Solutions

I managed to work out solution:

 

If(
DataCardValue3.Selected.Value="Andere",
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 0,
Value: TextInput1.Text
},
DataCardValue3.Selected
)

View solution in original post

5 REPLIES 5
FernandoTC
Resolver II
Resolver II

Hi @LukasSliuzas 

I would appreciate if you can provide more info. However lets work with what we have until the moment.

As I can figure out, you got a Form to write in your SP list. Among the data cards within your Form, there is one particular (DataCard3) with the DropDown control that displays several choices, being one of them "Other".

What you need here is that, when the user selects "Other" on the DropDown list, one TextInput appears and the data sent to SP list on that particular field is the one the user types into the TextInput instead of the selected item "Other" in the dropdown.

 

If I supposed correctly everything above, the problem here might be that the field you are trying to update/summit is a choice field in the sharepoint list. This means you cannot add one value that is outside the options available for that field. 

If that is the case, I would recomend you to turn that SP list field into a Text one, and hard-code the options in the Items property of yout DropDown. Then the cpde you specified will work properly now, as you can add any Text type data to that field and you are no longer restricted to the choices you specified in the SP list.

Hope you find it helpful

mdevaney
Super User
Super User

@LukasSliuzas 
What error are you getting?  Can you please share the screenshot?

Where did you put this code?  It should go in the Update property of the Card.

If(DataCardValue3.Selected.Value = "Andere", TextInput1.Text, DataCardValue3.Selected.Value) 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I managed to work out solution:

 

If(
DataCardValue3.Selected.Value="Andere",
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 0,
Value: TextInput1.Text
},
DataCardValue3.Selected
)

View solution in original post

Yes I did put that under Update but I got syntax error

@LukasSliuzas 
You didn't specify it was a LOOKUP column type lol.  Glad you found the answer though.  Best of luck 🙂

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,329)