web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update a DataCard with...
Power Apps
Answered

Update a DataCard with an IF statement

(0) ShareShare
ReportReport
Posted on by

I thought this would be easy, but apparently not.  I would like to update a DataCard with two different fields depending on the FormMode.  Here's the formula that I used, that did not work:

 

If(FormMode = FormMode.New, 'DataCard-POnumber'.Text, TextInput3)

 

The Default for 'DataCard-PONumber' is below.  The field is also only visible in new mode.  MyVar is a global variable set by selecting an item from a gallery Set(MyVar,ThisItem.'PO Number')

 

If(SharePointForm1.Mode = FormMode.New, MyVar ,ThisItem.Purchase_x0020_Order)

 

The Default for 'TextInput3' is below.  It only shows up in FormMode.Edit

 

ThisItem.'Purchase Order Number'

 

Is it possible to have an IF statement to Update the item?

Categories:
I have the same question (0)
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    What kind of error are you getting. Because in the first line you are referencing the control itself which is TextInput3. You have to reference it's properties

    If(FormMode = FormMode.New, 'DataCard-POnumber'.Text, TextInput3.Text)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard