cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jimb0
New Member

Dynamically change the field referenced by a card

I have one unlocked card (Card1) in a form and I need to change the field it references based on the value selected in a pick list (Picklist1)

 

For Example,

 

Card1 currently references Field1

The Card1 DataField = "Field1" and the Default = "ThisItem.Field1"

I want to change the value in Picklist  from 1 to 2 and have Card1 DataField = "Field2" and the Default = "ThisItem.Field2"

 

I've tried updating these values with formulas in the OnChange event of Picklist.  The formula has no errors for DataField, but gives me a type error for Default because they are numeric fields and I am trying to enter text (ThisItem.Field2)

 

Any help is appreciated!

1 REPLY 1
mdevaney
Community Champion
Community Champion

@Jimb0 
You can convert a text value to number by placing it inside the VALUE function.  Doing this will likely remove the error.

 

Value(ThisItem.Field2)

 

---
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."

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,341)